summaryrefslogtreecommitdiffstats
path: root/application/errors
diff options
context:
space:
mode:
Diffstat (limited to 'application/errors')
-rw-r--r--application/errors/error_general.php44
-rw-r--r--application/errors/error_php.php3
2 files changed, 45 insertions, 2 deletions
diff --git a/application/errors/error_general.php b/application/errors/error_general.php
index fd63ce2c5..6c67fa33f 100644
--- a/application/errors/error_general.php
+++ b/application/errors/error_general.php
@@ -1,3 +1,43 @@
+<?php
+
+// fancy error page only works if we can load helpers
+if (class_exists("CI_Controller") && !isset($GLOBALS["is_error_page"])) {
+ $title = "Error";
+ $GLOBALS["is_error_page"] = true;
+
+ $CI =& get_instance();
+ $CI->load->helper("filebin");
+ $CI->load->helper("url");
+
+ if (static_storage("response_type") == "json") {
+ $array = array(
+ "status" => "error",
+ "message" => strip_tags($message),
+ );
+ header('Content-type: application/json');
+ echo json_encode($array);
+ exit();
+ }
+
+ if (is_cli_client()) {
+ $message = strip_tags($message);
+ echo "$heading: $message\n";
+ exit();
+ }
+
+ include 'application/views/header.php';
+
+ ?>
+ <div class="error">
+ <h1><?php echo $heading; ?></h1>
+ <?php echo $message; ?>
+ </div>
+
+ <?php
+ include 'application/views/footer.php';
+} else {
+ // default CI error page
+?>
<!DOCTYPE html>
<html lang="en">
<head>
@@ -59,4 +99,6 @@ p {
<?php echo $message; ?>
</div>
</body>
-</html> \ No newline at end of file
+</html>
+<?php
+}
diff --git a/application/errors/error_php.php b/application/errors/error_php.php
index f085c2037..5f91e07a0 100644
--- a/application/errors/error_php.php
+++ b/application/errors/error_php.php
@@ -7,4 +7,5 @@
<p>Filename: <?php echo $filepath; ?></p>
<p>Line Number: <?php echo $line; ?></p>
-</div> \ No newline at end of file
+</div>
+<?php exit();