@@ 293-302 (lines=10) @@ | ||
290 | * |
|
291 | * @return array |
|
292 | */ |
|
293 | private function clientError(\GuzzleHttp\Exception\ClientException $exception) |
|
294 | { |
|
295 | $body = (string) $exception->getResponse()->getBody(); |
|
296 | ||
297 | return [ |
|
298 | 'status' => 'error', |
|
299 | 'http_code' => $exception->getResponse()->getStatusCode(), |
|
300 | 'body' => json_decode($body), |
|
301 | ]; |
|
302 | } |
|
303 | ||
304 | /** |
|
305 | * Parse the java exception that we receive from Smartcall's Tomcat's. |
|
@@ 311-320 (lines=10) @@ | ||
308 | * |
|
309 | * @return array |
|
310 | */ |
|
311 | private function parseError(\GuzzleHttp\Exception\ServerException $exception) |
|
312 | { |
|
313 | $body = (string) $exception->getResponse()->getBody(); |
|
314 | 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); |
|
315 | ||
316 | return [ |
|
317 | 'status' => 'error', |
|
318 | 'http_code' => $exception->getResponse()->getStatusCode(), |
|
319 | 'body' => $matches['6'], |
|
320 | ]; |
|
321 | } |
|
322 | ||
323 | /** |