Laravel 5 Exception error: FatalErrorException in Handler. php line 38 solution,

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.