From bf108af8e39082f4591df8c115f95b8127b7ff9f Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Mon, 3 Sep 2018 11:35:21 -0500 Subject: [PATCH] Added exception throw when code file cannot be found --- src/Build.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Build.php b/src/Build.php index 2dda936..e239914 100644 --- a/src/Build.php +++ b/src/Build.php @@ -96,6 +96,10 @@ class Build private function buildPage(Page $page): string { if (!empty($page->code)) { + if (!file_exists(config('code_dir') . '/' . $page->code)) { + throw new \Exception('Code file not found: ' . $page->code); + } + $code = file_get_contents(config('code_dir') . '/' . $page->code); $page->variables['code'] = $code; }