File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
packages/router/src/Exceptions Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 1010use Tempest \Core \Kernel ;
1111use Tempest \Http \GenericResponse ;
1212use Tempest \Http \HttpRequestFailed ;
13+ use Tempest \Http \Request ;
1314use Tempest \Http \Response ;
1415use Tempest \Http \Responses \Json ;
1516use Tempest \Http \Session \CsrfTokenDidNotMatch ;
1920use Tempest \View \GenericView ;
2021use Throwable ;
2122
23+ use function Tempest \get ;
2224use function Tempest \Support \arr ;
2325
2426final readonly class HttpExceptionHandler implements ExceptionHandler
@@ -52,7 +54,7 @@ public function handle(Throwable $throwable): void
5254
5355 private function renderErrorResponse (Status $ status , ?HttpRequestFailed $ exception = null ): Response
5456 {
55- if ($ exception -> request ->headers ->get ('Accept ' ) === 'application/json ' ) {
57+ if (get (Request::class) ->headers ->get ('Accept ' ) === 'application/json ' ) {
5658 return new Json (
5759 $ this ->appConfig ->environment ->isLocal () && $ exception !== null
5860 ? [
You can’t perform that action at this time.
0 commit comments