From: Andrew Dolgov Date: Sat, 16 Mar 2013 08:26:14 +0000 (+0400) Subject: pluginhandler: better error reporting X-Git-Tag: 1.7.5~177 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=aca71915c486df8618ee6a859b487551011d4284;p=tt-rss.git pluginhandler: better error reporting --- diff --git a/classes/pluginhandler.php b/classes/pluginhandler.php index df7058dc..eb859ab3 100644 --- a/classes/pluginhandler.php +++ b/classes/pluginhandler.php @@ -9,8 +9,14 @@ class PluginHandler extends Handler_Protected { $plugin = $pluginhost->get_plugin($_REQUEST["plugin"]); - if (method_exists($plugin, $method)) { - $plugin->$method(); + if ($plugin) { + if (method_exists($plugin, $method)) { + $plugin->$method(); + } else { + print json_encode(array("error" => "METHOD_NOT_FOUND")); + } + } else { + print json_encode(array("error" => "PLUGIN_NOT_FOUND")); } } }