logException($exception, $data); $this->syslogger()->warning($exception->getMessage()." on ".$exception->getFile().":".$exception->getLine(), $data); $this->template()->setSubtemplate("main", "/templates/error/errpage.tpl", [ "errorText" => "Error: ".$exception->getMessage()." (".$exception->getCode().")"."" ]); } /** * @param Throwable $e * @return string */ public function checkError(Throwable $e) : string { ($e instanceof Exception) ? $this->logException($e) : $this->logError($e); if($e instanceof DTOException || $e instanceof DomainException || $e instanceof ServiceException) return $e->getMessage(); return "Ошибка. Дата и время: ".date("d-m-Y H:i:s"); } }