From bb1eabd001954b5f9eb58b61f850a0cea111f87a Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 10 Jul 2018 01:08:53 +0200 Subject: [PATCH] page: catch exceptions in placeholder scripts Inline error (similar to missing) instead of global breakage. --- page.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/page.php b/page.php index b160e45..33a1f44 100644 --- a/page.php +++ b/page.php @@ -42,8 +42,15 @@ function getoutput($blocks = []) $Args .= '/'.$param; } } - include "$name.php"; - $html = ob_get_clean(); + try { + include "$name.php"; + $html = ob_get_clean(); + } + catch (Exception $e) { + $html = sprintf('%s', + "fout in $name: {$e->getMessage()}" + ); + } } else { $html = ''.$name.' ontbreekt'; -- 2.30.0