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 --- classes/handler/public.php | 2 +- classes/pluginhandler.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'classes') diff --git a/classes/handler/public.php b/classes/handler/public.php index e170a2631..46c74041c 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -706,7 +706,7 @@ class Handler_Public extends Handler { function index() { header("Content-Type: text/plain"); - print json_encode(array("error" => array("code" => 7))); + print error_json(13); } function forgotpass() { diff --git a/classes/pluginhandler.php b/classes/pluginhandler.php index 690305165..5ca5c17d3 100644 --- a/classes/pluginhandler.php +++ b/classes/pluginhandler.php @@ -11,10 +11,10 @@ class PluginHandler extends Handler_Protected { if (method_exists($plugin, $method)) { $plugin->$method(); } else { - print json_encode(array("error" => "METHOD_NOT_FOUND")); + print error_json(13); } } else { - print json_encode(array("error" => "PLUGIN_NOT_FOUND")); + print error_json(14); } } } -- cgit v1.2.3-54-g00ecf