Lean code
This commit is contained in:
parent
c1d1ce49da
commit
45811dfb95
|
|
@ -71,8 +71,7 @@ class ServiceProvider extends ModuleServiceProvider
|
|||
*/
|
||||
App::error(function(\Exception $exception, $httpCode){
|
||||
$handler = new ErrorHandler;
|
||||
$isConsole = App::runningInConsole();
|
||||
return $handler->handleException($exception, $httpCode, $isConsole);
|
||||
return $handler->handleException($exception, $httpCode);
|
||||
});
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -37,14 +37,10 @@ class ErrorHandler
|
|||
* @param Exception $proposedException The exception candidate that has been thrown.
|
||||
* @return View Object containing the error page.
|
||||
*/
|
||||
public function handleException(\Exception $proposedException, $httpCode = 500, $isCli = false)
|
||||
public function handleException(\Exception $proposedException, $httpCode = 500)
|
||||
{
|
||||
// Disable the error handler for CLI environment
|
||||
if ($isCli)
|
||||
return;
|
||||
|
||||
// Disable the error handler for test environment
|
||||
if (Config::getEnvironment() == 'testing')
|
||||
// Disable the error handler for test and CLI environment
|
||||
if (App::runningUnitTests() || App::runningInConsole())
|
||||
return;
|
||||
|
||||
// Detect AJAX request and use error 500
|
||||
|
|
|
|||
Loading…
Reference in New Issue