mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 01:22:23 -04:00
Improved error printing in dev site
This commit is contained in:
parent
96f2da708a
commit
f66f6e3287
2 changed files with 12 additions and 11 deletions
22
lib/Core.php
22
lib/Core.php
|
@ -11,16 +11,18 @@ mb_http_output('UTF-8');
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
|
|
||||||
// Custom error handler to output more details about the specific Apache request that caused an exception.
|
// Custom error handler to output more details about the specific Apache request that caused an exception.
|
||||||
set_exception_handler(function(Throwable $ex): void{
|
if(SITE_STATUS == SITE_STATUS_LIVE){
|
||||||
$errorString = "----------------------------------------\n";
|
set_exception_handler(function(Throwable $ex): void{
|
||||||
$errorString .= trim(vds(array_intersect_key($_SERVER, ['REQUEST_URI' => '', 'QUERY_STRING' => '', 'REQUEST_METHOD' => '', 'REDIRECT_QUERY_STRING' => '', 'REDIRECT_URL' => '', 'SCRIPT_FILENAME' => '', 'REMOTE_ADDR' => '', 'HTTP_COOKIE' => '', 'HTTP_USER_AGENT' => '', 'SCRIPT_URI' => ''])));
|
$errorString = "----------------------------------------\n";
|
||||||
|
$errorString .= trim(vds(array_intersect_key($_SERVER, ['REQUEST_URI' => '', 'QUERY_STRING' => '', 'REQUEST_METHOD' => '', 'REDIRECT_QUERY_STRING' => '', 'REDIRECT_URL' => '', 'SCRIPT_FILENAME' => '', 'REMOTE_ADDR' => '', 'HTTP_COOKIE' => '', 'HTTP_USER_AGENT' => '', 'SCRIPT_URI' => ''])));
|
||||||
|
|
||||||
if(sizeof($_POST) > 0){
|
if(sizeof($_POST) > 0){
|
||||||
$errorString .= "POST DATA:\n";
|
$errorString .= "POST DATA:\n";
|
||||||
$errorString .= vds($_POST);
|
$errorString .= vds($_POST);
|
||||||
}
|
}
|
||||||
|
|
||||||
error_log($errorString);
|
error_log($errorString);
|
||||||
|
|
||||||
throw $ex; // Send the exception back to PHP for its usual logging routine.
|
throw $ex; // Send the exception back to PHP for its usual logging routine.
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
|
@ -139,7 +139,6 @@ class DbConnection{
|
||||||
else{
|
else{
|
||||||
$done = true;
|
$done = true;
|
||||||
if(SITE_STATUS == SITE_STATUS_DEV){
|
if(SITE_STATUS == SITE_STATUS_DEV){
|
||||||
print($sql);
|
|
||||||
throw($ex);
|
throw($ex);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue