您好,欢迎访问一九零五行业门户网

laravel 5异常FatalErrorException in Handler.php line 38如何解决

本文主要给大家介绍了关于laravel 5异常错误:fatalerrorexception in handler.php line 38的解决方法,文中将解决方法介绍的非常详细,需要的朋友可以参考借鉴,下面随着小编来一起学习学习吧。希望能帮助到大家。
前言
本文主要给大家介绍了关于laravel5异常错误fatalerrorexception in handler.php line 38的解决,分享出来供大家参考学习,话不多说了,来一起看看详细的介绍。
1、错误提示
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:38 stack 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
原因:d:wwwactivityvendorcompiled.php on line 1817 的变量$e不是exception的实例对象(对错误提示的翻译……^.^笑cry)
2、解决方案
在提示的错误地方加上变量$e的实例判断,如果不是exception类型,就new一个
if (!$e instanceof \exception) {  $e = new fatalthrowableerror($e); }
new完之后的样子:
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);  } }
相关推荐:
详解如何在iis 7下安装laravel 5.4环境
提升laravel 5性能的一些实用技巧
使用laravel 5.1出现no supported encrypter found报错的解决方法
以上就是laravel 5异常fatalerrorexception in handler.php line 38如何解决的详细内容。
其它类似信息

推荐信息