Exception error in Laravel5: Workaround for fatalerrorexception in handler.php line38

Source: Internet
Author: User
This article mainly introduces you about the Laravel 5 exception error: Fatalerrorexception in the handler.php Line 38 solution, the article will introduce the solution is very detailed, the need for friends can reference, Follow the small series to learn together.

Objective

This article mainly introduces to you about the LARAVEL5 exception error fatalerrorexception in the handler.php line 38 solution, shares out for everybody reference study, words not to say, come together to see the detailed introduction.

1. Error hints


Fatalerrorexception in handler.php line 38:uncaught typeerror:argument 1 passed to App\exceptions\handler::report () must Be a instance of Exception, instance of Error given, called in D:\www\activity\vendor\compiled.php on line 1817 and Defi Ned 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

Reason: d:wwwactivityvendorcompiled.php on line 1817 variable $e is not an instance object of exception (translation of error hints ... ^.^ laughter cry)

2. Solutions

In the wrong place of the hint with the example of variable $e, if it is not the exception type, the new one


if (! $e instanceof \exception) {$e = new Fatalthrowableerror ($e);}

What it looks like when new is finished:


Public Function HandleException ($e) {if (! $e instanceof \exception) {  $e = new Fatalthrowableerror ($e);} $this->ge Texceptionhandler ()->report ($e); if ($this->app->runninginconsole ()) {  $this->renderforconsole ($e);} else {  $this- Renderhttpresponse ($e); }}

Summarize

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.