Add method to return an int from the parameters.
[Sone.git] / src / main / java / net / pterodactylus / sone / freenet / fcp / FcpInterface.java
index 3657f8f..8da41ed 100644 (file)
@@ -38,9 +38,6 @@ import freenet.support.api.Bucket;
  */
 public class FcpInterface {
 
-       /** The core. */
-       private final Core core;
-
        /** All available FCP commands. */
        private final Map<String, Command> commands = Collections.synchronizedMap(new HashMap<String, Command>());
 
@@ -51,7 +48,6 @@ public class FcpInterface {
         *            The core
         */
        public FcpInterface(Core core) {
-               this.core = core;
                commands.put("Version", new VersionCommand());
                commands.put("GetPostFeed", new GetPostFeedCommand(core));
        }
@@ -81,8 +77,8 @@ public class FcpInterface {
                        /* TODO - return error? */
                        return;
                }
-               Reply reply = command.execute(parameters, data, AccessType.values()[accessType]);
                try {
+                       Reply reply = command.execute(parameters, data, AccessType.values()[accessType]);
                        SimpleFieldSet replyParameters = reply.getReplyParameters();
                        replyParameters.putOverwrite("Identifier", identifier);
                        if (reply.hasData()) {
@@ -92,6 +88,8 @@ public class FcpInterface {
                        } else {
                                pluginReplySender.send(replyParameters);
                        }
+               } catch (FcpException fe1) {
+                       /* TODO - log, report */
                } catch (PluginNotFoundException pnfe1) {
                        /* TODO - log */
                }