From 27f7b59353a076120407d8873ea86f5eea7d1dcf Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 30 Mar 2015 13:02:24 +0300 Subject: add a wrapper for standard error codes returned by backend, also add explanation to the error object if possible --- include/functions2.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/functions2.php') 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))); + + } ?> -- cgit v1.2.3-54-g00ecf