| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public static function populateFromClientException(ClientException $e) |
||
| 25 | { |
||
| 26 | $data = json_decode($e->getResponse()->getBody()); |
||
| 27 | |||
| 28 | // find out what kind of error happend and give some extra help |
||
| 29 | if (strpos($data->reason, 'inequivalent arg \'durable\'') !== false) { |
||
| 30 | $data->cause = 'Queue already exists with different durable stat, delete the queue first'; |
||
| 31 | } |
||
| 32 | |||
| 33 | $res = new Response($e->getCode(), $e->getResponse()->getHeaders(), json_encode($data)); |
||
| 34 | return new JobResult($res); |
||
| 35 | } |
||
| 36 | |||
| 60 |