-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Description
When some of my code throws an \Error
or \Exception
, the error I get back includes a "location", but no indication of where the error occurred — no file, or class name, or trace.
Is this by design? Could we do something like this in formatError()
?
if (!empty($prev)) {
if ($prev instanceof ValidationError) {
$error['validation'] = $prev->getValidatorMessages()->toArray();
} else if ($prev instanceof \Throwable) {
// Throw in the trace so one can know where an exception occurred
$error['trace'] = explode("\n", $prev->getTraceAsString());
}
}
That would give us a nicely formatted trace back to where the original \Throwable
was thrown, so the error is findable (though it should probably be switched based on env(APP_DEBUG)
)
Metadata
Metadata
Assignees
Labels
No labels