@@ -276,18 +276,18 @@ |
||
| 276 | 276 | * @return array |
| 277 | 277 | */ |
| 278 | 278 | private function parseIndexErrorException(Exception $e): array { |
| 279 | - // Remove leading ErrorMessage like: "400 Bad Request: " from ElasticSearch to make json_decode work again |
|
| 280 | - $jsonexmsg = preg_replace('/^[^{]*/', '', $e->getMessage()); |
|
| 281 | - $arr = json_decode($jsonexmsg, true); |
|
| 282 | - |
|
| 283 | - if (!is_array($arr)) { |
|
| 284 | - // If still parsing is impossible give a hint on what went wrong (parsing) in logs... |
|
| 285 | - $jsonerror = json_last_error_msg(); |
|
| 286 | - $this->logger->error(sprintf("parseIndexErrorException(%s): ex=%s", $jsonerror, $jsonexmsg)); |
|
| 287 | - |
|
| 288 | - // Give a hint in the unknown error what went wrong |
|
| 289 | - return ['error', 'unknown error: ' . $jsonexmsg, '']; |
|
| 290 | - } |
|
| 279 | + // Remove leading ErrorMessage like: "400 Bad Request: " from ElasticSearch to make json_decode work again |
|
| 280 | + $jsonexmsg = preg_replace('/^[^{]*/', '', $e->getMessage()); |
|
| 281 | + $arr = json_decode($jsonexmsg, true); |
|
| 282 | + |
|
| 283 | + if (!is_array($arr)) { |
|
| 284 | + // If still parsing is impossible give a hint on what went wrong (parsing) in logs... |
|
| 285 | + $jsonerror = json_last_error_msg(); |
|
| 286 | + $this->logger->error(sprintf("parseIndexErrorException(%s): ex=%s", $jsonerror, $jsonexmsg)); |
|
| 287 | + |
|
| 288 | + // Give a hint in the unknown error what went wrong |
|
| 289 | + return ['error', 'unknown error: ' . $jsonexmsg, '']; |
|
| 290 | + } |
|
| 291 | 291 | |
| 292 | 292 | if (empty($this->getArray('error', $arr))) { |
| 293 | 293 | return ['error', $e->getMessage(), '']; |