From c9913b99a47eb187eefe3286c2c9bc8e575cb825 Mon Sep 17 00:00:00 2001 From: User Date: Mon, 26 Jun 2023 19:58:03 +0300 Subject: [PATCH] 20230626#1 --- src/Content.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Content.php b/src/Content.php index 2a2bb55..4df17fb 100644 --- a/src/Content.php +++ b/src/Content.php @@ -2,6 +2,7 @@ namespace Rmphp\Content; +use Rmphp\Foundation\Exceptions\AppError; use Rmphp\Foundation\Exceptions\AppException; use Rmphp\Foundation\TemplateInterface; @@ -140,9 +141,10 @@ class Content implements TemplateInterface { /** * @return string + * @throws AppException */ public function getResponse(): string { - if (empty($this->template) || !file_exists($this->template)) return ''; + if (empty($this->template) || !file_exists($this->template)) throw new AppError("Invalid template file"); ob_start(); include $this->template; $out = ob_get_contents(); ob_end_clean(); return $out; }