mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 01:17:30 -05:00 
			
		
		
		
	Update error handler for L5.2
This commit is contained in:
		
							parent
							
								
									02670fabed
								
							
						
					
					
						commit
						245efeee2f
					
				@ -4,7 +4,11 @@ use Redirect;
 | 
			
		||||
use Utils;
 | 
			
		||||
use Exception;
 | 
			
		||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
 | 
			
		||||
use Illuminate\Http\Exception\HttpResponseException; 
 | 
			
		||||
use Illuminate\Auth\Access\AuthorizationException;
 | 
			
		||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
 | 
			
		||||
use Symfony\Component\HttpKernel\Exception\HttpException;
 | 
			
		||||
use Illuminate\Foundation\Validation\ValidationException;
 | 
			
		||||
 | 
			
		||||
class Handler extends ExceptionHandler {
 | 
			
		||||
 | 
			
		||||
@ -14,7 +18,10 @@ class Handler extends ExceptionHandler {
 | 
			
		||||
	 * @var array
 | 
			
		||||
	 */
 | 
			
		||||
	protected $dontReport = [
 | 
			
		||||
		'Symfony\Component\HttpKernel\Exception\HttpException'
 | 
			
		||||
        AuthorizationException::class,
 | 
			
		||||
        HttpException::class,
 | 
			
		||||
        ModelNotFoundException::class,
 | 
			
		||||
        ValidationException::class,
 | 
			
		||||
	];
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
@ -27,6 +34,11 @@ class Handler extends ExceptionHandler {
 | 
			
		||||
	 */
 | 
			
		||||
	public function report(Exception $e)
 | 
			
		||||
	{
 | 
			
		||||
        // don't show these errors in the logs
 | 
			
		||||
        if ($e instanceof HttpResponseException) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        if (Utils::isNinja()) {
 | 
			
		||||
            Utils::logError(Utils::getErrorString($e));
 | 
			
		||||
            return false;
 | 
			
		||||
@ -59,6 +71,9 @@ class Handler extends ExceptionHandler {
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return parent::render($request, $e);
 | 
			
		||||
 | 
			
		||||
        /*
 | 
			
		||||
        // In production, except for maintenance mode, we'll show a custom error screen
 | 
			
		||||
        if (Utils::isNinjaProd() && !Utils::isDownForMaintenance()) {
 | 
			
		||||
            $data = [
 | 
			
		||||
@ -70,5 +85,6 @@ class Handler extends ExceptionHandler {
 | 
			
		||||
        } else {
 | 
			
		||||
            return parent::render($request, $e);
 | 
			
		||||
        }
 | 
			
		||||
        */
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user