Skip to content

Commit

Permalink
Only call getSeverity on ErrorException classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Oli Griffiths committed Jul 21, 2015
1 parent 008ebde commit 3935598
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Whoops/Exception/Inspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ protected function getTrace(\Exception $e)
{
$traces = $e->getTrace();

// Get trace from xdebug if enabled, failure exceptions only trace to the shutdown handler by default
if (!$e instanceof \ErrorException) {
return $traces;
}

switch ($e->getSeverity()) {
case E_ERROR:
case E_RECOVERABLE_ERROR:
Expand All @@ -152,8 +157,7 @@ protected function getTrace(\Exception $e)
break;
}

// Get trace from xdebug if enabled, failure exceptions only trace to the shutdown handler by default
if (!$e instanceof \ErrorException || !$fatal) {
if (!$fatal) {
return $traces;
}

Expand Down

0 comments on commit 3935598

Please sign in to comment.