protected function returnError($description, $returnLink = true, $httpStatus = null)
    {
        if ($this->isXmlHttpRequest()) {
            $this->logWarning('Called '.__FUNCTION__.' in an unsupported AJAX context');
            throw new common_Exception($description);
        }

        $this->setData('message', $description);
        $this->setData('returnLink', $returnLink);

        if($httpStatus !== null && file_exists(Template::getTemplate("error/error${httpStatus}.tpl"))){
            $this->setView("error/error${httpStatus}.tpl", 'tao');
        } else {
            $this->setView('error/user_error.tpl', 'tao');
        }
    }
protected function returnError($description, $returnLink = true, $httpStatus = null)
    {
        if ($this->isXmlHttpRequest()) {
            $this->logWarning('Called '.__FUNCTION__.' in an unsupported AJAX context');
            throw new common_Exception($description);
        }

        $this->setData('message', $description);
        $this->setData('returnLink', $returnLink);

        if($httpStatus !== null && file_exists(Template::getTemplate("error/error${httpStatus}.tpl"))){
            $this->setView("error/error${httpStatus}.tpl", 'tao');
        } else {
            $this->setView('error/user_error.tpl', 'tao');
        }
    }
protected function returnError ( $ description , $ returnLink = true , $ httpStatus = null ) { if ( $ this -> isXmlHttpRequest ( ) ) { $ this -> logWarning ( 'Called ' . __FUNCTION__ . ' in an unsupported AJAX context' ) ; throw new common_Exception ( $ description ) ; } $ this -> setData ( 'message' , $ description ) ; $ this -> setData ( 'returnLink' , $ returnLink ) ; if ( $ httpStatus !== null && file_exists ( Template :: getTemplate ( "error/error${httpStatus}.tpl" ) ) ) { $ this -> setView ( "error/error${httpStatus}.tpl" , 'tao' ) ; } else { $ this -> setView ( 'error/user_error.tpl' , 'tao' ) ; } }
Function to return an user readable error
Does not work with ajax Requests yet

@param string $description error to show
@param boolean $returnLink whenever or not to add a return link
@param int $httpStatus
@throws common_Exception
Function to return an user readable error Does not work with ajax Requests yet