Conditions | 5 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | public function handle(Response $response) |
||
10 | { |
||
11 | if ($response->successful()) { |
||
12 | return; |
||
13 | } |
||
14 | |||
15 | if ($response->status() === 429) { |
||
16 | throw new TooManyRequestsException($response); |
||
17 | } |
||
18 | |||
19 | if ($response->status() === 422) { |
||
20 | throw new ValidationException($response->json('errors', [])); |
||
21 | } |
||
22 | |||
23 | if ($response->status() === 404) { |
||
24 | throw new NotFoundException(); |
||
25 | } |
||
26 | |||
27 | $response->throw(); |
||
28 | } |
||
30 |