Conditions | 3 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public static function NetgsmRespondedWithAnError(ClientException $exception) |
||
17 | { |
||
18 | $statusCode = $exception->getResponse()->getStatusCode(); |
||
19 | $description = 'no description given'; |
||
20 | if ($result = json_decode($exception->getResponse()->getBody())) { |
||
21 | $description = $result->description ?: $description; |
||
22 | } |
||
23 | |||
24 | return new static("Netgsm responded with an error `{$statusCode} - {$description}`"); |
||
25 | } |
||
27 |