/** * Override CErrorHandler handle event to process error stack * * @param mixed $event */ public function handle($event) { if (YII_DEBUG == false && $event instanceof CExceptionEvent && $event->exception instanceof XException && $this->errorAction != '') { // If a XException is thrown it should be handled friendly as the way exception is handled in NON DEBUG mode // Therefore, we will cast the exception into CHttpException so that CErrorHandler will runs errorAction $exception = $event->exception; $event->exception = new CHttpException(500, $exception->getMessage()); } if (YII_DEBUG) { // Yii tries to run the errorAction if it's set even in debug mode // while we do not like that. It helps only if the action can provide // more details than Yii default error/exception debug report. $this->errorAction = null; } parent::handle($event); if ($this->sendNotificationEmail && array_search($this->Error['code'], $this->excludedCodes) === false) { // Send email to admin if debug is turn off $this->notifyByMail($this->Error); } }
/** * Log the pretty html stack dump before the parent handles the error. * @param CErrorEvent|CExceptionEvent $event */ public function handle($event) { if ($event instanceof CExceptionEvent) { $this->logExceptionEvent($event); } else { $this->logErrorEvent($event); } parent::handle($event); }
public function handle($event) { parent::handle($event); }