mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
log errors in exception handler
This commit is contained in:
parent
f836683a9c
commit
d29e82a543
1 changed files with 7 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue