/** * Runs the defined error module * Sets the state of the module object to \c failed and sets the error code. * * @param mixed $errorCode * @param mixed $errorType * @param array $parameters * @param mixed $userParameters * * @see setErrorModule(), errorModule() */ function handleError($errorCode, $errorType = false, $parameters = array(), $userParameters = false) { if (!$errorType) { eZDebug::writeWarning("No error type specified for error code {$errorCode}, assuming kernel.\nA specific error type should be supplied, please check your code.", 'eZModule::handleError'); $errorType = 'kernel'; } // @todo Make this non static $errorModule = eZModule::errorModule(); // @todo Does this need to be static ? $module = eZModule::findModule($errorModule['module'], $this); if ($module === null) { return false; } $result = $module->run($errorModule['view'], array($errorType, $errorCode, $parameters, $userParameters)); // The error module may want to redirect to another URL, see error.ini if ($this->exitStatus() != eZModule::STATUS_REDIRECT and $this->exitStatus() != eZModule::STATUS_RERUN) { $this->setExitStatus(eZModule::STATUS_FAILED); $this->setErrorCode($errorCode); } return $result; }