|
@@ 330-339 (lines=10) @@
|
| 327 |
|
* |
| 328 |
|
* @return array |
| 329 |
|
*/ |
| 330 |
|
private function clientError(\GuzzleHttp\Exception\ClientException $exception): array |
| 331 |
|
{ |
| 332 |
|
$body = (string) $exception->getResponse()->getBody(); |
| 333 |
|
|
| 334 |
|
return [ |
| 335 |
|
'status' => 'error', |
| 336 |
|
'http_code' => $exception->getResponse()->getStatusCode(), |
| 337 |
|
'body' => json_decode($body), |
| 338 |
|
]; |
| 339 |
|
} |
| 340 |
|
|
| 341 |
|
/** |
| 342 |
|
* Parse the java exception that we receive from Smartcall's Tomcat's. |
|
@@ 348-357 (lines=10) @@
|
| 345 |
|
* |
| 346 |
|
* @return array |
| 347 |
|
*/ |
| 348 |
|
private function parseError(\GuzzleHttp\Exception\ServerException $exception): array |
| 349 |
|
{ |
| 350 |
|
$body = (string) $exception->getResponse()->getBody(); |
| 351 |
|
preg_match('/<p><b>(JBWEB\d{6}): type<\/b> (JBWEB\d{6}): Exception report<\/p><p><b>(JBWEB\d{6}): message<\/b> <u>(.*[^<\/u>])<\/u><\/p><p><b>(JBWEB\d{6}): description<\/b> <u>(.+[^<\/u>])<\/u><\/p>/ims', $body, $matches); |
| 352 |
|
|
| 353 |
|
return [ |
| 354 |
|
'status' => 'error', |
| 355 |
|
'http_code' => $exception->getResponse()->getStatusCode(), |
| 356 |
|
'body' => $matches['6'], |
| 357 |
|
]; |
| 358 |
|
} |
| 359 |
|
|
| 360 |
|
/** |