Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-11-24 21:07:26 +0400
committerFrank Karlitschek <frank@owncloud.org>2012-11-24 21:07:26 +0400
commit0f6181627835572ce70fddfc4decc14b1213a715 (patch)
tree798b9b565ba86a28f8112752cbf88ac1d561c194 /lib/template.php
parentfb5d0db0376f8f75fe6745fd1c94d5b325be4f41 (diff)
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.php15
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();
+ }
+
+
}