@@ 265-274 (lines=10) @@ | ||
262 | * |
|
263 | * @return array |
|
264 | */ |
|
265 | private function clientError(\GuzzleHttp\Exception\ClientException $exception): array |
|
266 | { |
|
267 | $body = (string) $exception->getResponse()->getBody(); |
|
268 | ||
269 | return [ |
|
270 | 'status' => 'error', |
|
271 | 'http_code' => $exception->getResponse()->getStatusCode(), |
|
272 | 'body' => json_decode($body), |
|
273 | ]; |
|
274 | } |
|
275 | ||
276 | /** |
|
277 | * Parse the java exception that we receive from Smartcall's Tomcat's. |
|
@@ 283-292 (lines=10) @@ | ||
280 | * |
|
281 | * @return array |
|
282 | */ |
|
283 | private function parseError(\GuzzleHttp\Exception\ServerException $exception): array |
|
284 | { |
|
285 | $body = (string) $exception->getResponse()->getBody(); |
|
286 | 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); |
|
287 | ||
288 | return [ |
|
289 | 'status' => 'error', |
|
290 | 'http_code' => $exception->getResponse()->getStatusCode(), |
|
291 | 'body' => $matches['6'], |
|
292 | ]; |
|
293 | } |
|
294 | ||
295 | /** |