protected function injectException($model, $e)
{
if (!$this->displayExceptions()) {
return;
}
$model->setVariable('display_exceptions', true);
$exception = $e->getParam('exception', false);
// @TODO clean up once PHP 7 requirement is enforced
if (!$exception instanceof \Exception && !$exception instanceof \Throwable) {
return;
}
$model->setVariable('exception', $exception);
}