Prado\Exceptions\TErrorHandler::handleExternalError PHP Méthode

handleExternalError() protected méthode

THttpException and errors happened when the application is in Debug mode will be displayed to the client user.
protected handleExternalError ( $statusCode, $exception )
    protected function handleExternalError($statusCode, $exception)
    {
        if (!$exception instanceof THttpException) {
            error_log($exception->__toString());
        }
        $content = $this->getErrorTemplate($statusCode, $exception);
        $serverAdmin = isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN'] : '';
        $isDebug = $this->getApplication()->getMode() === TApplicationMode::Debug;
        $errorMessage = $exception->getMessage();
        if ($isDebug) {
            $version = $_SERVER['SERVER_SOFTWARE'] . ' <a href="https://github.com/pradosoft/prado4">PRADO</a>/' . Prado::getVersion();
        } else {
            $version = '';
            $errorMessage = self::hideSecurityRelated($errorMessage, $exception);
        }
        $tokens = array('%%StatusCode%%' => "{$statusCode}", '%%ErrorMessage%%' => htmlspecialchars($errorMessage), '%%ServerAdmin%%' => $serverAdmin, '%%Version%%' => $version, '%%Time%%' => @strftime('%Y-%m-%d %H:%M', time()));
        $this->getApplication()->getResponse()->setStatusCode($statusCode, $isDebug ? $exception->getMessage() : null);
        echo strtr($content, $tokens);
    }