1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 04:55:54 +00:00

pluginhandler: better error reporting

This commit is contained in:
Andrew Dolgov
2013-03-16 12:26:14 +04:00
parent 1b113281ff
commit aca71915c4

View File

@@ -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"));
}
}
}