Skip to content

Commit 2a8ca93

Browse files
committed
FIX: set data after encoding options
1 parent d0fcfe9 commit 2a8ca93

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: Services/ExceptionResponseService.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ public function __construct(bool $debug = false) {
3434
*/
3535
public function createResponseFromHttpException(HttpExceptionInterface $exception): Response {
3636
// Note: Encoding options needs to be set before data
37-
return (new JsonResponse($this->getData($exception), $exception->getStatusCode(), $exception->getHeaders()))
38-
->setEncodingOptions(JsonResponse::DEFAULT_ENCODING_OPTIONS | JSON_INVALID_UTF8_IGNORE);
37+
return (new JsonResponse(null, $exception->getStatusCode(), $exception->getHeaders()))
38+
->setEncodingOptions(JsonResponse::DEFAULT_ENCODING_OPTIONS | JSON_INVALID_UTF8_IGNORE)
39+
->setData($this->getData($exception));
3940
}
4041

4142
/**

0 commit comments

Comments
 (0)