fredmarks
190
11
Laravel

Exception handler 500 error

Posted 3 months ago by fredmarks

I have added an some custom exception handling for ajax request

\App\Exeptions\Handler.php


public function render($request, Exception $exception)
{

  //do something different when its an ajax call
  if ($request->ajax() && in_array($exception->getStatusCode(), array(403, 419, 404, 409))) {

      //retun ajax respone

   }

    return parent::render($request, $exception);
}

This is all working fine, however when my code generates a 500 error (e.g. Method does not exist) no output is generated in either debugbar or chrome developer tools.

The only place I now see the exception message is in the log file.

Any ideas how to get around this, so that I can still get my debugging exceptions for 500 errors?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.