20 lines
397 B
PHP
20 lines
397 B
PHP
<?php
|
|
|
|
|
|
function handle_error(Exception $error) :void
|
|
{
|
|
error_log(
|
|
'ERROR: '.$error->getMessage().' in '.$error->getFile().':'.$error->getLine().
|
|
PHP_EOL.'Stack trace:'.PHP_EOL.$error->getTraceAsString()
|
|
);
|
|
http_response_code(500);
|
|
\App\template\Error::printError(500);
|
|
die();
|
|
}
|
|
|
|
|
|
function redirect($uri) :void
|
|
{
|
|
header('Location: '.BASE.$uri);
|
|
die();
|
|
} |