Skip to content

Commit

Permalink
Add comment clarifying handling of null response object
Browse files Browse the repository at this point in the history
  • Loading branch information
namespacebrian committed Sep 20, 2023
1 parent 228cbd1 commit 5d7c16f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Request/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ private function createRetryDecider(): callable
}
}

// It's been observed in the wild that sometimes $response is null. Get a different error message in that case.
if (is_object($response) && is_object($response->getBody()) && $response->getBody()->getContents() !== '') {
$error = $response->getBody()->getContents();
} elseif (null !== $exception && '' != $exception->getMessage()) {
Expand Down

0 comments on commit 5d7c16f

Please sign in to comment.