Php Laravel FatalErrorException,但代码似乎没有问题

Php Laravel FatalErrorException,但代码似乎没有问题,php,laravel,laravel-5,Php,Laravel,Laravel 5,我正在处理Laravel5.0抛出的FatalErrorException,没有有用的描述 我们有一个用laravel 5.0开发的web应用程序,angularJS中有一小部分,我在macbook air 2015上工作 git项目的一个分支似乎不能在我的机器上工作,尽管其他分支工作得很好,而且配置没有变化,代码也没有大的变化。而且,它在我同事的机器上工作 以下是返回的错误消息: local.ERROR: Symfony\Component\Debug\Exception\FatalError

我正在处理Laravel5.0抛出的
FatalErrorException
,没有有用的描述

我们有一个用laravel 5.0开发的web应用程序,angularJS中有一小部分,我在macbook air 2015上工作

git项目的一个分支似乎不能在我的机器上工作,尽管其他分支工作得很好,而且配置没有变化,代码也没有大的变化。而且,它在我同事的机器上工作

以下是返回的错误消息:

local.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: 
Uncaught TypeError: Argument 1 passed to App\Exceptions\Handler::report() must be an instance of Exception, 
instance of ParseError given, called in Applications/XAMPP/htdocs/myApp/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 73 and defined in /Applications/XAMPP/htdocs/myApp/app/Exceptions/Handler.php:36
下面是Handler.php
use Exception;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;


use Tymon\JWTAuth\Exceptions\JWTException;

use Tymon\JWTAuth\Exceptions\TokenExpiredException;
use Tymon\JWTAuth\Exceptions\TokenInvalidException;
use Tymon\JWTAuth\Exceptions\TokenBlacklistedException;

use Flash;
use Response;

class Handler extends ExceptionHandler {

    /**
     * A list of the exception types that should not be reported.
     *
     * @var array
     */
    protected $dontReport = [
        'Symfony\Component\HttpKernel\Exception\HttpException'
    ];

    /**
     * Report or log an exception.
     *
     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
     *
     * @param  \Exception  $e
     * @return void
     */
    public function report(Exception $e)
    {
        parent::report($e);
    }

    /**
     * Render an exception into an HTTP response.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Exception  $e
     * @return \Illuminate\Http\Response
     */
    public function render($request, Exception $e)
    {
        if ($e instanceof ModelNotFoundException) {
            if ($request->ajax()) {
                return Response::json(null, 403);
            }
            $modelName = str_replace("No query results for model [App\Models\\", "", $e->getMessage());
            $modelName = str_replace("].", "", $modelName);
            Flash::error(trans(lcfirst($modelName) . '.not_found'));
            return redirect()->back();
        }
        if ($e instanceof TokenBlacklistedException) {
        return response()->json(['error' => 'token_blacklisted', 'description' => 'descrizione errore token blacklisted'], $e->    getStatusCode());
        }
        if ($e instanceof TokenInvalidException) {
        return response()->json(['error' => 'token_invalid', 'description' => 'descrizione errore token invalid'], $e->getStatusCode())    ;
        }
        if ($e instanceof TokenExpiredException) {
        return response()->json(['error' => 'token_expired', 'description' => 'descrizione errore token expired'], $e->getStatusCode())    ;
        }
        if ($this->isHttpException($e)) {
            return $this->renderHttpException($e);
        }

        return parent::render($request, $e);
/*
        if ($this->isHttpException($e))
        {
            return $this->renderHttpException($e);
        }
        else
        {
            return parent::render($request, $e);
        }
*/
    }

}
每当我忘记导入时,我就习惯于看到这种类型的通用消息,但情况似乎并非如此。我怀疑我在配置中遗漏了什么

错误发生在每个页面上,但登录页面和中的部分除外

一旦我登录并被重定向到主页,它就会崩溃


任何帮助都将不胜感激。

请显示
app/Exceptions/Handler.php
文件。我想您有PHP7或更新版本,对吗?如果是,Laravel 5.0不正确支持PHP7:(出于某种原因,
ParseError
会被发送到异常处理程序。这不应该发生。您也不应该一开始就收到解析错误。@user2094178done@Maraboc但是它只在我的机器上抛出错误,所以我想这不是兼容性问题
use Exception;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;


use Tymon\JWTAuth\Exceptions\JWTException;

use Tymon\JWTAuth\Exceptions\TokenExpiredException;
use Tymon\JWTAuth\Exceptions\TokenInvalidException;
use Tymon\JWTAuth\Exceptions\TokenBlacklistedException;

use Flash;
use Response;

class Handler extends ExceptionHandler {

    /**
     * A list of the exception types that should not be reported.
     *
     * @var array
     */
    protected $dontReport = [
        'Symfony\Component\HttpKernel\Exception\HttpException'
    ];

    /**
     * Report or log an exception.
     *
     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
     *
     * @param  \Exception  $e
     * @return void
     */
    public function report(Exception $e)
    {
        parent::report($e);
    }

    /**
     * Render an exception into an HTTP response.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Exception  $e
     * @return \Illuminate\Http\Response
     */
    public function render($request, Exception $e)
    {
        if ($e instanceof ModelNotFoundException) {
            if ($request->ajax()) {
                return Response::json(null, 403);
            }
            $modelName = str_replace("No query results for model [App\Models\\", "", $e->getMessage());
            $modelName = str_replace("].", "", $modelName);
            Flash::error(trans(lcfirst($modelName) . '.not_found'));
            return redirect()->back();
        }
        if ($e instanceof TokenBlacklistedException) {
        return response()->json(['error' => 'token_blacklisted', 'description' => 'descrizione errore token blacklisted'], $e->    getStatusCode());
        }
        if ($e instanceof TokenInvalidException) {
        return response()->json(['error' => 'token_invalid', 'description' => 'descrizione errore token invalid'], $e->getStatusCode())    ;
        }
        if ($e instanceof TokenExpiredException) {
        return response()->json(['error' => 'token_expired', 'description' => 'descrizione errore token expired'], $e->getStatusCode())    ;
        }
        if ($this->isHttpException($e)) {
            return $this->renderHttpException($e);
        }

        return parent::render($request, $e);
/*
        if ($this->isHttpException($e))
        {
            return $this->renderHttpException($e);
        }
        else
        {
            return parent::render($request, $e);
        }
*/
    }

}