Maurits van der Schee 5 years ago
parent
commit
6e3c454ada
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/Tqdev/PhpCrudApi/ResponseUtils.php

+ 1
- 1
src/Tqdev/PhpCrudApi/ResponseUtils.php View File

@@ -23,7 +23,7 @@ class ResponseUtils
23 23
     public static function addExceptionHeaders(ResponseInterface $response, \Throwable $e): ResponseInterface
24 24
     {
25 25
         $response = $response->withHeader('X-Exception-Name', get_class($e));
26
-        $response = $response->withHeader('X-Exception-Message', $e->getMessage());
26
+        $response = $response->withHeader('X-Exception-Message', preg_replace('|\n|', ' ', trim($e->getMessage())));
27 27
         $response = $response->withHeader('X-Exception-File', $e->getFile() . ':' . $e->getLine());
28 28
         return $response;
29 29
     }

Loading…
Cancel
Save