Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit d231e1b

Browse files
p-blombergahsankhatri
authored andcommitted
Store http response code in UnhandledRequestError (#12)
This allows the user to deal with errors in a more informed way - for example, if the response code is 502 or 503, it might be a good idea to wait 15-30 seconds and try again.
1 parent 493c826 commit d231e1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Exceptions/UnhandledRequestError.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ class UnhandledRequestError extends \Exception
77
public function __construct($code, $response)
88
{
99
$message = 'The request failed with the error: '.$code.'. Response: '.$response;
10-
parent::__construct($message);
10+
parent::__construct($message, $code);
1111
}
1212
}

0 commit comments

Comments
 (0)