Skip to content

Commit

Permalink
Bugfix: Exception handler couldn't catch Router exceptions because of…
Browse files Browse the repository at this point in the history
… missing namespace use
  • Loading branch information
gintsmurans committed Aug 3, 2017
1 parent 90a3265 commit e5495dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion System/Modules/Core/Helpers/Bootstrap.php
Expand Up @@ -5,7 +5,6 @@
use \Core\Models\Config;
use \Core\Models\Timers;
use \Core\Models\Router;
use \Core\Models\RouterException;

/*
* Handle cli sapi
Expand Down
4 changes: 2 additions & 2 deletions System/Modules/Core/Helpers/ErrorHandlers.php
Expand Up @@ -3,6 +3,7 @@
use \Core\Models\Load;
use \Core\Models\Config;
use \Core\Models\Router;
use \Core\Models\RouterException;

/**
* StaticPHP's error handler. Turns errors into exceptions and passes on to sp_exception_handler().
Expand Down Expand Up @@ -63,8 +64,7 @@ function sp_exception_handler($exception)
if ($exception instanceof RouterException) {
if (!empty(Config::$items['debug'])) {
Router::error('500', 'Internal Server Error', $exception->getMessage());
}
else {
} else {
Router::error('404', 'Not Found');
}
}
Expand Down

0 comments on commit e5495dd

Please sign in to comment.