Skip to content

Commit

Permalink
Exception handler should return json response on ajax call (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanhao LI committed Feb 13, 2020
1 parent 61a1e81 commit dec4714
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ public function render($request, Exception $e)
return $this->convertValidationExceptionToResponse($e, $request);
}

if ($this->isJsonOutputFormat) {
return $this->prepareJsonResponse($request, $e);
}

return $this->renderHttpExceptionWithView($request, $e);
}

Expand Down

0 comments on commit dec4714

Please sign in to comment.