From 00603f61fcb21312df38be1ccfb6b4a97494be43 Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sat, 1 Oct 2016 18:58:04 +0200 Subject: [PATCH] Add integrated 404 Not Found page Resolves #299 --- lib/Pico.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Pico.php b/lib/Pico.php index 10abb8c..034c294 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -847,8 +847,14 @@ class Pico return $this->loadFileContent($contentDir . '404' . $contentExt); } - $errorFile = $contentDir . '404' . $contentExt; - throw new RuntimeException('Required "' . $errorFile . '" not found'); + // fallback to built-in error message + $rawErrorContent = "---\n" + . "Title: Error 404\n" + . "Robots: noindex,nofollow\n" + . "---\n\n" + . "# Error 404\n\n" + . "Woops. Looks like this page doesn't exist.\n"; + return $rawErrorContent; } /**