How enable detailed error messages in Laravel? -


i using laravel 5.5, , realized in version, errors seems bit 'user-friendly'... how detailed error messages again?

for example: before, code:

abort(500, 'the server on fire');

i saw message "the server on fire". now, see "whoops, looks went wrong."

thanks in advance!

the reason you're getting error because you're aborting 500 code. laravel check if there error view relating error code (which there is) , in turn display view.

out of box laravel comes 404, 419, 429, 500, 503 error views.

i suggest using code more appropriate situation (if possible). here's list of of error codes https://httpstatuses.com/.

failing override default behaviour adding following app/exceptions/handler.php class:

/**  * render given httpexception.  *  * @param  \symfony\component\httpkernel\exception\httpexception  $e  * @return \symfony\component\httpfoundation\response  */ protected function renderhttpexception(httpexception $e) {     $status = $e->getstatuscode();      if ($status == 500 && config('app.debug')) {         return $this->convertexceptiontoresponse($e);     }      return parent::renderhttpexception($e); 

essentially, bypass looking 500.blade.php error view , should display stack whoops. please note not tested against actual 500 error i'm not sure if work (i can't think of why wouldn't wanted mention it).

hope helps!


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -