response code only over http in exception handler
This commit is contained in:
parent
a65b3b24ce
commit
ccf10e3f47
1 changed files with 2 additions and 1 deletions
3
init.php
3
init.php
|
@ -9,7 +9,8 @@ set_error_handler(function ($level, $message, $file = '', $line = 0) {
|
|||
});
|
||||
set_exception_handler(function ($e) {
|
||||
error_log((string) $e);
|
||||
http_response_code(500);
|
||||
if (http_response_code() !== false)
|
||||
http_response_code(500);
|
||||
echo '<h1>Error</h1><p>An error occured.</p>' . LF;
|
||||
});
|
||||
register_shutdown_function(function () { // Also catch fatal errors
|
||||
|
|
Loading…
Reference in a new issue