You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a retry is specified within the HTTP client, and the retry limit is reached, then the response is automatically thrown. Since there is no way to hook into the throw method, you'll always get a RequestException. Therefore, you cannot do things like $response->failed()
The problem lies within Illuminate\Http\Client\PendingRequest, on lines 682-684:
if ($this->tries > 1 && ! $response->successful()) {
$response->throw();
}
Steps To Reproduce:
Simply, add a retry configuration to the HTTP client:
Http::fake([
'*' => Http::response(['error'], 403),
]);
$response = Http::retry(3, 5000)->post('https://example.com/route');
// The above line throws a RequestException, so the below error handling will not be reachedif ($response->failed()) {
// error handling
}
The text was updated successfully, but these errors were encountered:
Description:
When a retry is specified within the HTTP client, and the retry limit is reached, then the response is automatically thrown. Since there is no way to hook into the
throw
method, you'll always get aRequestException
. Therefore, you cannot do things like$response->failed()
The problem lies within
Illuminate\Http\Client\PendingRequest
, on lines 682-684:Steps To Reproduce:
Simply, add a retry configuration to the HTTP client:
The text was updated successfully, but these errors were encountered: