summaryrefslogtreecommitdiff
path: root/include/functions2.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-03-30 13:02:24 +0300
committerAndrew Dolgov <[email protected]>2015-03-30 13:02:24 +0300
commit27f7b59353a076120407d8873ea86f5eea7d1dcf (patch)
tree0c9c3b0a7b705dc09855a6f308303427077590f9 /include/functions2.php
parentf75e7c64460b8337ecc769fb956cbe8a08b351e4 (diff)
add a wrapper for standard error codes returned by backend, also add explanation to the error object if possible
Diffstat (limited to 'include/functions2.php')
-rw-r--r--include/functions2.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/functions2.php b/include/functions2.php
index c0ed7a823..a73f9a7a7 100644
--- a/include/functions2.php
+++ b/include/functions2.php
@@ -2452,4 +2452,14 @@
return false;
}
+
+ function error_json($code) {
+ require_once "errors.php";
+
+ @$message = $ERRORS[$code];
+
+ return json_encode(array("error" =>
+ array("code" => $code, "message" => $message)));
+
+ }
?>