summaryrefslogtreecommitdiff
path: root/classes/pluginhandler.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-03-16 12:26:14 +0400
committerAndrew Dolgov <[email protected]>2013-03-16 12:26:14 +0400
commitaca71915c486df8618ee6a859b487551011d4284 (patch)
tree6141e485cb3485c8ad8f02d17a007fd6d2e0ed1e /classes/pluginhandler.php
parent1b113281ffa3c0fad96b139df39de566567b8d9d (diff)
pluginhandler: better error reporting
Diffstat (limited to 'classes/pluginhandler.php')
-rw-r--r--classes/pluginhandler.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/classes/pluginhandler.php b/classes/pluginhandler.php
index df7058dcd..eb859ab32 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"));
}
}
}