From ca361076589ea38feddb2a4672f294c58ae4aabc Mon Sep 17 00:00:00 2001 From: Thomas Arrow Date: Mon, 15 Jun 2026 16:57:31 +0100 Subject: [PATCH] default to JSON responses for exceptions Overwrite the default error handler in our custom handler to so it shouldReturnJson is always true. This prevents http responses (and the confusing redirect) with ValidationExceptions Bug: T429021 --- app/Exceptions/Handler.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 325b86c5..ed1976b0 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -25,4 +25,8 @@ public function register(): void { (new ErrorReporting())->report($e); }); } + + protected function shouldReturnJson($request, Throwable $e): bool { + return true; + } }