protected function getExceptionResponse($e) {
		while(ob_get_level() > $this->startObLevel)
			ob_end_clean();

		$this->errorHandler->exceptionHandler($e);

		$trace = $this->errorHandler->getBacktraceFromException($e);

		if($e instanceof \Asgard\Debug\PSRException)
			$msg = $e->getMessage();
		elseif($e instanceof \ErrorException)
			$msg = 'PHP ('.$this->errorHandler->getPHPError($e->getCode()).'): '.$e->getMessage();
		else
			$msg = get_class($e).': '.$e->getMessage();

		$result = '<b>Message</b><br>'."\n"
			. $msg."<hr>\n"
			. \Asgard\Debug\Debug::getReport($trace);

		$response = new \Asgard\Http\Response(500);
		if($this->debug)
			return $response->setHeader('Content-Type', 'text/html')->setContent($result);
		else {
			$msg = isset($this->translator) ? $this->translator->trans('<h1>Error</h1>Oops, something went wrong.'):'<h1>Error</h1>Oops, something went wrong.';
			return $response->setHeader('Content-Type', 'text/html')->setContent($msg);
		}
	}
protected function getExceptionResponse($e) {
		while(ob_get_level() > $this->startObLevel)
			ob_end_clean();

		$this->errorHandler->exceptionHandler($e);

		$trace = $this->errorHandler->getBacktraceFromException($e);

		if($e instanceof \Asgard\Debug\PSRException)
			$msg = $e->getMessage();
		elseif($e instanceof \ErrorException)
			$msg = 'PHP ('.$this->errorHandler->getPHPError($e->getCode()).'): '.$e->getMessage();
		else
			$msg = get_class($e).': '.$e->getMessage();

		$result = '<b>Message</b><br>'."\n"
			. $msg."<hr>\n"
			. \Asgard\Debug\Debug::getReport($trace);

		$response = new \Asgard\Http\Response(500);
		if($this->debug)
			return $response->setHeader('Content-Type', 'text/html')->setContent($result);
		else {
			$msg = isset($this->translator) ? $this->translator->trans('<h1>Error</h1>Oops, something went wrong.'):'<h1>Error</h1>Oops, something went wrong.';
			return $response->setHeader('Content-Type', 'text/html')->setContent($msg);
		}
	}
protected function getExceptionResponse ( $ e ) { while ( ob_get_level ( ) > $ this -> startObLevel ) ob_end_clean ( ) ; $ this -> errorHandler -> exceptionHandler ( $ e ) ; $ trace = $ this -> errorHandler -> getBacktraceFromException ( $ e ) ; if ( $ e instanceof \ Asgard \ Debug \ PSRException ) $ msg = $ e -> getMessage ( ) ; elseif ( $ e instanceof \ ErrorException ) $ msg = 'PHP (' . $ this -> errorHandler -> getPHPError ( $ e -> getCode ( ) ) . '): ' . $ e -> getMessage ( ) ; else $ msg = get_class ( $ e ) . ': ' . $ e -> getMessage ( ) ; $ result = '<b>Message</b><br>' . "\n" . $ msg . "<hr>\n" . \ Asgard \ Debug \ Debug :: getReport ( $ trace ) ; $ response = new \ Asgard \ Http \ Response ( 500 ) ; if ( $ this -> debug ) return $ response -> setHeader ( 'Content-Type' , 'text/html' ) -> setContent ( $ result ) ; else { $ msg = isset ( $ this -> translator ) ? $ this -> translator -> trans ( '<h1>Error</h1>Oops, something went wrong.' ) : '<h1>Error</h1>Oops, something went wrong.' ; return $ response -> setHeader ( 'Content-Type' , 'text/html' ) -> setContent ( $ msg ) ; } }
Get a response from an exception.
@param  \Exception|\Throwable $e
@return Response
Get a response from an exception .