summaryrefslogtreecommitdiffstats
path: root/application/errors
diff options
context:
space:
mode:
Diffstat (limited to 'application/errors')
-rwxr-xr-xapplication/errors/error_general.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/application/errors/error_general.php b/application/errors/error_general.php
index da3999cbd..fc3d3f607 100755
--- a/application/errors/error_general.php
+++ b/application/errors/error_general.php
@@ -9,6 +9,16 @@ if (class_exists("CI_Controller") && !isset($GLOBALS["is_error_page"])) {
$CI->load->helper("filebin");
$CI->load->helper("url");
+ if (request_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";