Adjust frames to display ErrorException

This commit is contained in:
Iacovos Constantinou
2013-06-08 07:39:08 +03:00
parent 703c10a7e9
commit a857eb60ff
+17 -2
View File
@@ -68,8 +68,7 @@ class Inspector
// and do not add the current exception to trace. We ensure that
// the next frame does have a filename / linenumber, though.
if($this->exception instanceof ErrorException && empty($frames[1]['line'])) {
$frames[1] = isset($frames[1]) ? $frames[1] + $frames[0] : $frames[0];
array_shift($frames);
$frames = array($this->getFrameFromError($this->exception));
} else {
$firstFrame = $this->getFrameFromException($this->exception);
array_unshift($frames, $firstFrame);
@@ -97,4 +96,20 @@ class Inspector
)
);
}
/**
* Given an error, generates an array in the format
* generated by ErrorException
* @param ErrorException $exception
* @return array
*/
protected function getFrameFromError(ErrorException $exception)
{
return array(
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'class' => null,
'args' => array()
);
}
}