protected function getHtmlFromTemplate(\Throwable $e) : string
    {
        $suffix = $this->getConfigParam('view')['templateSuffix'];
        $subDir = $this->getConfigParam('view')['templateErrorSubDirApp'];
        $templateErrorGeneric = $this->getConfigParam('view')['templateErrorGeneric'];
        if ($e instanceof HttpException) {
            $templateNameByStatusCode = $subDir . '/' . $e->getStatusCode() . $suffix;
            if ($html = $this->renderTemplate($templateNameByStatusCode)) {
                return $html;
            }
        }
        
        $templateNameByExceptionName = $subDir . '/'. (new \ReflectionClass($e))->getShortName() . $suffix;
        if ($html = $this->renderTemplate($templateNameByExceptionName)) {
            return $html;
        }
        
        $templateErrorGeneric = $subDir . '/'. $templateErrorGeneric . $suffix;
        if ($html = $this->renderTemplate($templateErrorGeneric)) {
            return $html;
        }
        
        $exceptionClass = get_class($e);
        throw new TemplateNotFoundException(
            "A template for {$exceptionClass} exception should have been located but wasn't."
        );
    }