function handle($args) { parent::handle($args); $this->code = $this->trimmed('code'); if (!$this->code || $code < 400 || $code > 499) { $this->code = $this->default; } $this->message = $this->trimmed('message'); if (!$this->message) { $this->message = "Client Error {$this->code}"; } $this->showPage(); }
protected function handle() { parent::handle(); $this->code = $this->trimmed('code'); if (!$this->code || $code < 500 || $code > 599) { $this->code = $this->default; } $this->message = $this->trimmed('message'); if (!$this->message) { $this->message = "Server Error {$this->code}"; } $this->showPage(); }
if (isset($route->params['action'])) { // take the action class directly from the route $action = $route->params['action']; } else { // use a default action class $action = 'home'; } $action_class = ucfirst($action) . 'Action'; if (!class_exists($action_class)) { $error = new ErrorAction($_lang); $error->setErrorMessage(400, 'Unkown action <' . $action_class . '>'); $error->handle(); } $actionClass = new $action_class($_lang); try { if ($actionClass->prepare($route->params)) { $actionClass->handle(); } } catch (ClientException $e) { $error = new ErrorAction($_lang); $error->setErrorMessage($e->getCode(), 'ClientException:' . $e->getMessage()); $error->handle(); } catch (ServerException $e) { $error = new ErrorAction($_lang); $error->setErrorMessage($e->getCode(), 'ServerException: ' . $e->getMessage()); $error->handle(); } catch (Exception $e) { $error = new ErrorAction($_lang); $error->setErrorMessage(500, 'Exception: ' . $e->getMessage()); $error->handle(); }