summaryrefslogtreecommitdiffstats
path: root/application/helpers
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2015-01-11 01:39:22 +0100
committerFlorian Pritz <bluewind@xinu.at>2015-01-16 17:38:38 +0100
commit434143c2b01c203bf9030669a14055872121b2c0 (patch)
tree129d606d3e0f3082b65f7c379a7fd2aa3e94286b /application/helpers
parent9670d794be886c036408de85773a0b7d204979b9 (diff)
improve api errors
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/helpers')
-rw-r--r--application/helpers/filebin_helper.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/application/helpers/filebin_helper.php b/application/helpers/filebin_helper.php
index 465f865f6..a1b540b1d 100644
--- a/application/helpers/filebin_helper.php
+++ b/application/helpers/filebin_helper.php
@@ -235,10 +235,11 @@ function send_json_reply($array, $status = "success")
$CI->output->set_output(json_encode($reply));
}
-function send_json_error_reply($message, $array = null)
+function send_json_error_reply($error_id, $message, $array = null, $status_code = 400)
{
$reply = array();
$reply["status"] = "error";
+ $reply["error_id"] = $error_id;
$reply["message"] = $message;
if ($array !== null) {
@@ -246,7 +247,7 @@ function send_json_error_reply($message, $array = null)
}
$CI =& get_instance();
- $CI->output->set_status_header(400);
+ $CI->output->set_status_header($status_code);
$CI->output->set_content_type('application/json');
$CI->output->set_output(json_encode($reply));
}