mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Don't infer trace if explicitly provided
Requires https://github.com/Seldaek/monolog/pull/1080
This commit is contained in:
parent
c9921447b3
commit
c7ab5846df
@ -31,16 +31,18 @@ class DetailedErrorFormatter implements FormatterInterface
|
||||
}
|
||||
}
|
||||
|
||||
$trace = debug_backtrace();
|
||||
if (!isset($context['trace'])) {
|
||||
$trace = debug_backtrace();
|
||||
|
||||
// Filter out monolog plumbing from the trace
|
||||
// If the context file & line isn't found in the trace, then the trace is most likely
|
||||
// call to the fatal error handler and is not useful, so exclude it entirely
|
||||
$i = $this->findInTrace($trace, $context['file'], $context['line']);
|
||||
if ($i !== null) {
|
||||
$context['trace'] = array_slice($trace, $i);
|
||||
} else {
|
||||
$context['trace'] = null;
|
||||
// Filter out monolog plumbing from the trace
|
||||
// If the context file & line isn't found in the trace, then the trace is most likely
|
||||
// call to the fatal error handler and is not useful, so exclude it entirely
|
||||
$i = $this->findInTrace($trace, $context['file'], $context['line']);
|
||||
if ($i !== null) {
|
||||
$context['trace'] = array_slice($trace, $i);
|
||||
} else {
|
||||
$context['trace'] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user