diff --git a/src/ajax.php b/src/ajax.php index 498e4b5..3a8d3ad 100644 --- a/src/ajax.php +++ b/src/ajax.php @@ -798,14 +798,20 @@ function myErrorHandler($errno, $errstr, $errfile, $errline) function myExceptionHandler($e) { - try { // to avoid Exception thrown without a stack frame + // to avoid Exception thrown without a stack frame + try + { if(-1 == $e->getCode()) { + //thrown in myErrorHandler + error_log($e->getMessage()); echo $e->getMessage()."\n". $e->getTraceAsString(); exit; } + error_log('Exception: \''. $e->getMessage() .'\' in '. $e->getFile() .':'. $e->getLine()); echo 'Exception: \''. $e->getMessage() .'\' in '. $e->getFile() .':'. $e->getLine(); //."\n". $e->getTraceAsString(); } catch(Exception $e) { + error_log('Exception in ExceptionHandler: \''. $e->getMessage() .'\' in '. $e->getFile() .':'. $e->getLine()); echo 'Exception in ExceptionHandler: \''. $e->getMessage() .'\' in '. $e->getFile() .':'. $e->getLine(); } exit;