From 57c4677d52d82937d06829147649923f3d102579 Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 15 Dec 2023 02:40:25 +0000 Subject: [PATCH] Fixed error 500 on HTTP error pages. --- src/RoutingContext.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/RoutingContext.php b/src/RoutingContext.php index 27342aa..7ec5c07 100644 --- a/src/RoutingContext.php +++ b/src/RoutingContext.php @@ -22,9 +22,9 @@ class RoutingContext { } public function registerDefaultErrorPages(): void { - $this->router->addErrorHandler(401, fn($resp) => $resp->setContent($this->templating->rendering('errors/401'))); - $this->router->addErrorHandler(403, fn($resp) => $resp->setContent($this->templating->rendering('errors/403'))); - $this->router->addErrorHandler(404, fn($resp) => $resp->setContent($this->templating->rendering('errors/404'))); + $this->router->addErrorHandler(401, fn($resp) => $resp->setContent($this->templating->render('errors/401'))); + $this->router->addErrorHandler(403, fn($resp) => $resp->setContent($this->templating->render('errors/403'))); + $this->router->addErrorHandler(404, fn($resp) => $resp->setContent($this->templating->render('errors/404'))); $this->router->addErrorHandler(500, fn($resp) => $resp->setContent(file_get_contents(HAU_DIR_TEMPLATES . '/errors/500.html'))); $this->router->addErrorHandler(503, fn($resp) => $resp->setContent(file_get_contents(HAU_DIR_TEMPLATES . '/errors/503.html'))); }