migrate to php8

This commit is contained in:
ivan shalganov
2023-02-23 21:50:12 +01:00
parent b04c38a533
commit e8647cfb02
6 changed files with 40 additions and 14 deletions

View File

@@ -10,6 +10,7 @@
namespace Fenom;
use Fenom;
use Fenom\Error\TemplateException;
/**
* Primitive template
@@ -210,10 +211,15 @@ class Render extends \ArrayObject
* Execute template and write into output
* @param array $values for template
* @return array
* @throws TemplateException
*/
public function display(array $values): array
{
$this->_code->__invoke($values, $this);
try {
$this->_code->__invoke($values, $this);
} catch (\Throwable $e) {
throw new Fenom\Error\TemplateException("unhandled exception in the template `{$this->getName()}`: {$e->getMessage()}", 0, $e);
}
return $values;
}