Laravel 5 Exception error: FatalErrorException in Handler. php line 38 solution,
Preface
This article describes how to solve the laravel5 Exception error FatalErrorException in Handler. php line 38. I will share it for your reference. I will not talk about it much. Let's take a look at the detailed introduction.
1. error message
FatalErrorException in Handler.php line 38:Uncaught TypeError: Argument 1 passed to App\Exceptions\Handler::report() must be an instance of Exception, instance of Error given, called in D:\www\activity\vendor\compiled.php on line 1817 and defined in D:\www\activity\app\Exceptions\Handler.php:38Stack trace:#0 D:\www\activity\vendor\compiled.php(1817): App\Exceptions\Handler->report(Object(Error))#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Error))#2 {main}thrown
Cause: D: The variable $ e of wwwactivityvendorcompiled. php on line 1817 is not the Exception Instance Object (translate the error message ...... ^. ^ Laugh cry)
2. Solutions
Add the instance variable $ e to the error prompt. If it is not of the Exception type, a new
if (!$e instanceof \Exception) { $e = new FatalThrowableError($e);}
After the new is complete:
public function handleException($e){ if (!$e instanceof \Exception) { $e = new FatalThrowableError($e); } $this->getExceptionHandler()->report($e); if ($this->app->runningInConsole()) { $this->renderForConsole($e); } else { $this->renderHttpResponse($e); }}
Summary
The above is all the content of this article. I hope the content of this article has some reference and learning value for everyone's learning or work. If you have any questions, please leave a message to us, thank you for your support.