summaryrefslogtreecommitdiff
path: root/framework/Exceptions/TErrorHandler.php
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2016-02-26 09:27:38 +0100
committerFabio Bas <ctrlaltca@gmail.com>2016-02-26 09:27:38 +0100
commitb01aac13a3bc71eec9a934050e4cf0a9f58b02e7 (patch)
treec485e82d8e164744b74841fc1d7a6ad11a557796 /framework/Exceptions/TErrorHandler.php
parent562e322fe595b4d3307ff28a96c8c5fbcc284010 (diff)
Intercept fatal errors using register_shutdown_function
Related discussion in #569
Diffstat (limited to 'framework/Exceptions/TErrorHandler.php')
-rw-r--r--framework/Exceptions/TErrorHandler.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php
index f9a120ac..02f86f5e 100644
--- a/framework/Exceptions/TErrorHandler.php
+++ b/framework/Exceptions/TErrorHandler.php
@@ -345,7 +345,12 @@ class TErrorHandler extends TModule
// if PHP exception, we want to show the 2nd stack level context
// because the 1st stack level is of little use (it's in error handler)
if($exception instanceof TPhpErrorException)
- $result=isset($trace[0]['file'])?$trace[0]:$trace[1];
+ {
+ if(isset($trace[0]['file']))
+ $result=$trace[0];
+ elseif(isset($trace[1]))
+ $result=$trace[1];
+ }
else if($exception instanceof TInvalidOperationException)
{
// in case of getter or setter error, find out the exact file and row