summaryrefslogtreecommitdiffstats
path: root/application/errors/error_general.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-08-14 17:06:07 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-09-02 22:02:27 +0200
commit84ce2c6ce0eb1b4f2f32c4ae0d7e08f3571f5018 (patch)
tree895a059bdc6d82a462a055764e761cdd16656a63 /application/errors/error_general.php
parentf8417cd3aa92f49cbe98188cd6fca2ec50da9613 (diff)
Provide json output for api functions
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/errors/error_general.php')
-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";