private function buildException()
    {
        if($this->isJsonRequest()){
            $this->setException(new ExceptionJson($this->message,$this->debugCode,$this->details,$this->errors));
        }else{
            $exception = new ExceptionView($this->message,$this->debugCode,$this->details,$this->errors);
            $exception->setViewPath($this->getVewPath());
            $exception->setRedirectPath($this->getRedirect());
            $this->setException($exception);
        }
    }