mirror of
https://github.com/filp/whoops.git
synced 2026-09-13 19:26:21 +00:00
Adjust frames to display ErrorException
This commit is contained in:
@@ -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()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user