diff --git a/src/Error/FormattedError.php b/src/Error/FormattedError.php index 7e611b8..42605ee 100644 --- a/src/Error/FormattedError.php +++ b/src/Error/FormattedError.php @@ -91,8 +91,12 @@ class FormattedError } if ($debug & self::INCLUDE_TRACE > 0) { - $debugging = $e->getPrevious() ?: $e; - $result['trace'] = static::toSafeTrace($debugging->getTrace()); + $isTrivial = $e instanceof Error && !$e->getPrevious(); + + if (!$isTrivial) { + $debugging = $e->getPrevious() ?: $e; + $result['trace'] = static::toSafeTrace($debugging->getTrace()); + } } return $result;