Catch errors
This commit is contained in:
parent
df52bab204
commit
cc9856ad39
3 changed files with 8 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Runtime\Http\Input;
|
||||
|
||||
use Runtime\Exceptions\ExceptionHandler;
|
||||
use Runtime\Exceptions\Exceptions\InvalidArgumentException;
|
||||
use Runtime\Http\Request;
|
||||
|
||||
|
@ -81,7 +82,7 @@ class InputHandler
|
|||
try {
|
||||
$list[$key] = InputFile::createFromArray($values + $value);
|
||||
} catch (InvalidArgumentException $e) {
|
||||
|
||||
ExceptionHandler::make($e);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -139,7 +140,7 @@ class InputHandler
|
|||
continue;
|
||||
|
||||
} catch (InvalidArgumentException $e) {
|
||||
|
||||
ExceptionHandler::make($e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class Route
|
|||
$routerOutput = ob_get_contents();
|
||||
ob_end_clean();
|
||||
} catch (\Exception $e) {
|
||||
|
||||
ExceptionHandler::make($e);
|
||||
}
|
||||
|
||||
// Try to parse library version
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Runtime\Router;
|
||||
|
||||
use Runtime\Exceptions\ExceptionHandler;
|
||||
use Runtime\Exceptions\Exceptions\InvalidArgumentException;
|
||||
use Runtime\Exceptions\Exceptions\MalformedUrlException;
|
||||
use Runtime\Http\Middleware\BaseCsrfVerifier;
|
||||
|
@ -130,6 +131,7 @@ class Router
|
|||
$this->request = new Request();
|
||||
} catch (MalformedUrlException $e) {
|
||||
$this->debug(sprintf('Invalid request-uri url: %s', $e->getMessage()));
|
||||
ExceptionHandler::make($e);
|
||||
}
|
||||
|
||||
$this->routes = [];
|
||||
|
@ -481,6 +483,7 @@ class Router
|
|||
*/
|
||||
protected function handleException(\Exception $e): ?string
|
||||
{
|
||||
|
||||
$this->debug('Starting exception handling for "%s"', \get_class($e));
|
||||
|
||||
$this->fireEvents(EventHandler::EVENT_LOAD_EXCEPTIONS, [
|
||||
|
@ -531,7 +534,7 @@ class Router
|
|||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
|
||||
ExceptionHandler::make($e);
|
||||
}
|
||||
|
||||
$this->debug('Finished processing');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue