Add integrated 404 Not Found page

Resolves #299
This commit is contained in:
Daniel Rudolf 2016-10-01 18:58:04 +02:00
parent a74db1ddbb
commit 00603f61fc
No known key found for this signature in database
GPG key ID: A061F02CD8DE4538

View file

@ -847,8 +847,14 @@ class Pico
return $this->loadFileContent($contentDir . '404' . $contentExt); return $this->loadFileContent($contentDir . '404' . $contentExt);
} }
$errorFile = $contentDir . '404' . $contentExt; // fallback to built-in error message
throw new RuntimeException('Required "' . $errorFile . '" not found'); $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;
} }
/** /**