Return exception in plain text for xhr requests
This commit is contained in:
parent
e83b9d1268
commit
a0d1924165
|
|
@ -71,7 +71,7 @@ class Handler extends ExceptionHandler
|
||||||
return parent::render($request, $e);
|
return parent::render($request, $e);
|
||||||
} else {
|
} else {
|
||||||
// hide exception details if not in debug mode
|
// hide exception details if not in debug mode
|
||||||
if (config('app.debug')) {
|
if (config('app.debug') && !$request->ajax()) {
|
||||||
return $this->renderExceptionWithWhoops($e);
|
return $this->renderExceptionWithWhoops($e);
|
||||||
} else {
|
} else {
|
||||||
return $this->renderExceptionInBrief($e);
|
return $this->renderExceptionInBrief($e);
|
||||||
|
|
@ -108,7 +108,7 @@ class Handler extends ExceptionHandler
|
||||||
*/
|
*/
|
||||||
protected function renderExceptionInBrief(Exception $e)
|
protected function renderExceptionInBrief(Exception $e)
|
||||||
{
|
{
|
||||||
if ($_SERVER['REQUEST_METHOD'] == "GET") {
|
if ($_SERVER['REQUEST_METHOD'] == "GET" && !app('request')->ajax()) {
|
||||||
return response()->view('errors.exception', ['message' => $e->getMessage()]);
|
return response()->view('errors.exception', ['message' => $e->getMessage()]);
|
||||||
} else {
|
} else {
|
||||||
return $e->getMessage();
|
return $e->getMessage();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user