protected function errorPage($message, $status = 500)
    {
        if ($message instanceof \Exception) {
            $strMessage = $this->getTranslator()->trans(
                "Sorry, an error occured: %msg",
                [ '%msg' => $message->getMessage() ]
            );

            Tlog::getInstance()->addError($strMessage.": ".$message->getTraceAsString());

            $message = $strMessage;
        } else {
            Tlog::getInstance()->addError($message);
        }

        return $this->render(
            'general_error',
            array(
                "error_message" => $message
            ),
            $status
        );
    }
protected function errorPage($message, $status = 500)
    {
        if ($message instanceof \Exception) {
            $strMessage = $this->getTranslator()->trans(
                "Sorry, an error occured: %msg",
                [ '%msg' => $message->getMessage() ]
            );

            Tlog::getInstance()->addError($strMessage.": ".$message->getTraceAsString());

            $message = $strMessage;
        } else {
            Tlog::getInstance()->addError($message);
        }

        return $this->render(
            'general_error',
            array(
                "error_message" => $message
            ),
            $status
        );
    }
protected function errorPage ( $ message , $ status = 500 ) { if ( $ message instanceof \ Exception ) { $ strMessage = $ this -> getTranslator ( ) -> trans ( "Sorry, an error occured: %msg" , [ '%msg' => $ message -> getMessage ( ) ] ) ; Tlog :: getInstance ( ) -> addError ( $ strMessage . ": " . $ message -> getTraceAsString ( ) ) ; $ message = $ strMessage ; } else { Tlog :: getInstance ( ) -> addError ( $ message ) ; } return $ this -> render ( 'general_error' , array ( "error_message" => $ message ) , $ status ) ; }
Return a general error page

@param \Exception|string $message a message string, or an exception instance
@param int    $status  the HTTP status (default is 500)

@return \Thelia\Core\HttpFoundation\Response
Return a general error page