/** * Encount error handler * * @access public * @author sakuragawa */ public function handleError($code, $description, $file = null, $line = null, $context = null) { $errorCode = EncountErrorHandler::mapErrorCode($code); $errorType = $errorCode[0]; $this->execute($code, $errorType, $description, $file, $line, $context); return parent::handleError($code, $description, $file, $line, $context); }
/** * Set as the default error handler by CakePHP. * * @param int $code Code of error * @param string $description Error description * @param string|null $file File on which error occurred * @param int|null $line Line that triggered the error * @param array|null $context Context * @return bool True if error was handled */ public function handleError($code, $description, $file = null, $line = null, $context = null) { $exception = new ErrorException($description, 0, $code, $file, $line); $sentryHandler = new SentryHandler(); $sentryHandler->handle($exception); return parent::handleError($code, $description, $file, $line, $context); }
/** * Intercept error handling to send a mail before continuing with the default logic * @see \Cake\Error\BaseErrorHandler::handleError() */ public function handleError($code, $description, $file = null, $line = null, $context = null) { // send a debug mail with the fatal error if ($this->email && !in_array($code, $this->_skipErrors)) { $this->email->debug('Application error', Misc::dump(['code' => $code, 'description' => $description, 'file' => $file, 'line' => $line, 'context' => $context], $description, true)); } // continue with error handle logic parent::handleError($code, $description, $file, $line, $context); }