Add support for 401 errors in the templating system

This commit is contained in:
2011-12-20 01:42:21 +00:00
parent 1a490a0ae0
commit 5181fe1b4c
2 changed files with 4 additions and 1 deletions

View File

@@ -13,6 +13,7 @@ class SihnonFramework_Exception_TemplateException extends SihnonFramework_E
class SihnonFramework_Exception_AbortEntirePage extends SihnonFramework_Exception_TemplateException {};
class SihnonFramework_Exception_Unauthorized extends SihnonFramework_Exception_TemplateException {};
class SihnonFramework_Exception_FileNotFound extends SihnonFramework_Exception_TemplateException {};
class SihnonFramework_Exception_NotAuthorised extends SihnonFramework_Exception_TemplateException {};
class SihnonFramework_Exception_InvalidParameters extends SihnonFramework_Exception_TemplateException {};
class SihnonFramework_Exception_DatabaseException extends SihnonFramework_Exception {};

View File

@@ -41,7 +41,9 @@ class SihnonFramework_Page {
} catch (SihnonFramework_Exception_AbortEntirePage $e) {
return false;
} catch (SihnonFramework_Exception_FileNotFound $e) {
$content = $this->render('errors/404.tpl', 'errors/404.php');
$content = $this->render('errors/404.tpl', 'errors/404.php');
} catch (SihnonFramework_Exception_NotAuthorised $e) {
$content = $this->render('errors/401.tpl', 'errors/404.php');
} catch (SihnonFramework_Exception $e) {
$content = $this->render('errors/unhandled-exception.tpl', 'errors/unhandled-exception.php', array(
'exception' => $e,