diff options
author | Frank Karlitschek <frank@owncloud.org> | 2012-11-24 18:07:26 +0100 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2012-11-24 18:07:26 +0100 |
commit | 0f6181627835572ce70fddfc4decc14b1213a715 (patch) | |
tree | 798b9b565ba86a28f8112752cbf88ac1d561c194 /lib/template.php | |
parent | fb5d0db0376f8f75fe6745fd1c94d5b325be4f41 (diff) | |
download | nextcloud-server-0f6181627835572ce70fddfc4decc14b1213a715.tar.gz nextcloud-server-0f6181627835572ce70fddfc4decc14b1213a715.zip |
A new function to create nice error page. And use it for fatal db errors
Diffstat (limited to 'lib/template.php')
-rw-r--r-- | lib/template.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/template.php b/lib/template.php index a10cabf5931..868d5f2ba2e 100644 --- a/lib/template.php +++ b/lib/template.php @@ -496,4 +496,19 @@ class OC_Template{ } return $content->printPage(); } + + /** + * @brief Print a fatal error page and terminates the script + * @param string $error The error message to show + * @param string $hint An option hint message + */ + public static function printErrorPage( $error, $hint = '' ) { + $error['error']=$error; + $error['hint']=$hint; + $errors[]=$error; + OC_Template::printGuestPage("", "error", array("errors" => $errors)); + die(); + } + + } |