output line and file of exception as trace not always contain it

This commit is contained in:
Ralf Becker 2021-10-09 08:43:32 +02:00
parent 59b684bb1d
commit 59794cc3a4

View File

@ -71,6 +71,7 @@ function _egw_log_exception($e,&$headline=null)
{ {
error_log($headline.($e instanceof egw_exception_warning ? ': ' : ' ('.get_class($e).'): '). error_log($headline.($e instanceof egw_exception_warning ? ': ' : ' ('.get_class($e).'): ').
$e->getMessage().(!empty($e->details) ? ': '.$e->details : '')); $e->getMessage().(!empty($e->details) ? ': '.$e->details : ''));
error_log('File: '.str_replace(EGW_SERVER_ROOT, '', $e->getFile()).', Line: '.$e->getLine());
foreach($trace as $line) foreach($trace as $line)
{ {
error_log($line); error_log($line);
@ -174,6 +175,7 @@ function egw_error_handler ($errno, $errstr, $errfile, $errline)
{ {
case E_RECOVERABLE_ERROR: case E_RECOVERABLE_ERROR:
case E_USER_ERROR: case E_USER_ERROR:
error_log(__METHOD__."($errno, '$errstr', '$errfile', $errline)");
throw new ErrorException($errstr, $errno, 0, $errfile, $errline); throw new ErrorException($errstr, $errno, 0, $errfile, $errline);
case E_WARNING: case E_WARNING: