Error Handler Progress
This commit is contained in:
parent
abff057943
commit
0f51826d3f
@ -32,6 +32,15 @@ class Autoloader {
|
|||||||
|
|
||||||
spl_autoload_register("Autoloader::ClassLoader");
|
spl_autoload_register("Autoloader::ClassLoader");
|
||||||
Autoloader::setRoot('/var/www/dev.steelants.cz/vasek/home-update/');
|
Autoloader::setRoot('/var/www/dev.steelants.cz/vasek/home-update/');
|
||||||
|
|
||||||
|
class ErrorHandler {
|
||||||
|
static function exception($exception){
|
||||||
|
error_log($exception);
|
||||||
|
header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
|
||||||
|
echo '<h1>Oops!</h1><p>Something went wrong!</p>';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
set_exception_handler("ErrorHandler::exception");
|
set_exception_handler("ErrorHandler::exception");
|
||||||
|
|
||||||
//Debug
|
//Debug
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
<?php
|
|
||||||
class ErrorHandler {
|
|
||||||
static function exception($exception){
|
|
||||||
error_log($exception);
|
|
||||||
header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);
|
|
||||||
echo '<h1>Oops!</h1><p>Something went wrong!</p>';
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user