Skip to content

Commit b9e51c7

Browse files
author
David Nahodyl
committed
added throw if so we get an exception if there's a 404 or something like that
1 parent 353189b commit b9e51c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Services/FileMakerConnection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ protected function makeRequest($method, $url, $params = [], ?PendingRequest $req
497497
}
498498

499499
$response = $request->withMiddleware($this->retryMiddleware())
500-
->{$method}($url, $params)->json();
500+
->{$method}($url, $params)->throw()->json();
501501

502502
// Check for errors
503503
$this->checkResponseForErrors($response);
@@ -537,7 +537,7 @@ protected function retryMiddleware()
537537

538538
$contents = $response->getBody()->getContents();
539539
$contents = json_decode($contents, true);
540-
if ($response && $response->getStatusCode() !== 200) {
540+
if ($response && $response->getStatusCode() !== 200 && $contents !== null) {
541541
$code = (int)Arr::first(Arr::pluck(Arr::get($contents, 'messages'), 'code'));;
542542
if ($code === 952 && $retries <= 1) {
543543
$refresh = true;

0 commit comments

Comments
 (0)