FIX: catch exceptions on homepage

This commit is contained in:
Michal Kváček
2016-04-04 21:42:13 +02:00
parent ceaf9e7d6a
commit 51b60440be
+7 -8
View File
@@ -12,16 +12,15 @@ class Homepage extends ContentPage
$page = $this->content->getHomepage();
// test if we have any homepage
/*if (!$page) {
return view('errors.homepageNotAvailable');
}*/
if (!$page) {
return view('errors.homepageNotAvailable', ['reason' => 'nothing set']);
}
// render page
/* try {
} catch (\Exception $e) {
return view('errors.homepageNotAvailable');
}*/
try {
return $this->renderPage($page);
} catch (\Exception $e) {
return view('errors.homepageNotAvailable', ['exception' => $e, 'reason' => 'exception']);
}
}
}