1
0
mirror of https://github.com/flarum/core.git synced 2025-08-02 06:30:53 +02:00

Add a "return home" link to 404 errors

This commit is contained in:
Toby Zerner
2017-11-29 13:23:25 +10:30
parent b7c1cc5cef
commit ea2fc1ff8a
4 changed files with 18 additions and 1 deletions

View File

@@ -85,7 +85,11 @@ class HandleErrors
// Log the exception (with trace)
$this->logger->debug($error);
$view = $this->view->make('flarum::error')->with('error', $error);
if (! $this->view->exists($name = 'flarum::error.'.$status)) {
$name = 'flarum::error.default';
}
$view = $this->view->make($name)->with('error', $error);
return new HtmlResponse($view->render(), $status);
}