]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions2.php
add a wrapper for standard error codes returned by backend, also add explanation...
[tt-rss.git] / include / functions2.php
index c0ed7a82302753a3725b0a95c00be4aadef4cf3e..a73f9a7a786342f0563e77680937fdbaffefbee0 100644 (file)
 
                return false;
        }
+
+       function error_json($code) {
+               require_once "errors.php";
+
+               @$message = $ERRORS[$code];
+
+               return json_encode(array("error" =>
+                       array("code" => $code, "message" => $message)));
+
+       }
 ?>