/** * Log uncaught exceptions. * @param $exception */ public function exception($exception) { $log = \Application::log(); if (!empty($log)) { $log->error($exception, $exception->getTrace()); } throw $exception; }