/** * Handles the PHP error. * @param CErrorEvent $event the PHP error event */ protected function handleError($event) { if (error_reporting() & $event->code) { $this->getSentryClient()->captureException($this->createErrorException($event->message, $event->code, $event->file, $event->line)); } parent::handleError($event); }
/** * First sends the error to Airbrake and then calls the parent method * @param CErrorEvent $event */ protected function handleError(CErrorEvent $event) { $client = $this->startClient(); $trace = debug_backtrace(); // skip the first 3 stacks as they do not tell the error position if (count($trace) > 3) { $trace = array_slice($trace, 3); } Yii::log('sending error report to Airbrake'); $client->notifyOnError($event->message, $trace); parent::handleError($event); }
/** * Forwards an error to Whoops. * @param CErrorEvent $event */ protected function handleError($event) { if (!YII_DEBUG) { parent::handleError($event); return; } $this->disableLogRoutes(); try { $this->whoops->handleError($event->code, $event->message, $event->file, $event->line); } catch (Exception $ex) { $this->handleException($ex); } }
/** * @inheritdoc */ protected function handleError($event) { \Rollbar::report_php_error($event->code, $event->message, $event->file, $event->line); parent::handleError($event); }
/** * Handles a PHP error. * * @param \CErrorEvent $event the PHP error event * * @return null */ protected function handleError($event) { $trace = debug_backtrace(); // Was this triggered by a Twig template directly? if (isset($trace[3]['object']) && $trace[3]['object'] instanceof \Twig_Template) { $exception = new \Twig_Error_Runtime($event->message); $this->handleTwigError($exception); } else { // Check to see if this happened while running a task foreach ($trace as $step) { if (isset($step['class']) && $step['class'] == __NAMESPACE__ . '\\TasksService' && $step['function'] == 'runTask') { $task = craft()->tasks->getRunningTask(); if ($task) { craft()->tasks->fail($task, $event->message . ' on line ' . $event->line . ' of ' . $event->file); } break; } } parent::handleError($event); } }
protected function handleError($e) { Monolog\Registry::main()->addError(self::codeToString($e->code) . ': ' . $e->message, array('code' => $e->code, 'message' => $e->message, 'file' => $e->file, 'line' => $e->line, 'params' => $e->params, 'environment' => Yii::app()->getComponent($this->monologComponentName)->environment)); parent::handleError($e); }