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