From c26426c7c7913f9fc595a96f26ea937bb27823e6 Mon Sep 17 00:00:00 2001 From: Kris McQueen Date: Tue, 21 Sep 2010 18:26:57 -0700 Subject: [PATCH] Throw an exception when the dispatcher can't find the implementation for an API command. --- server/src/com/cloud/api/ApiDispatcher.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java index 771e2f563e6..2a0540d19f3 100644 --- a/server/src/com/cloud/api/ApiDispatcher.java +++ b/server/src/com/cloud/api/ApiDispatcher.java @@ -151,6 +151,10 @@ public class ApiDispatcher { setupParameters(cmd, params); Implementation impl = cmd.getClass().getAnnotation(Implementation.class); + if (impl == null) { + throw new CloudRuntimeException("Unable to execute command " + cmd.getClass().getName() + ", no implementation specified."); + } + String methodName = impl.method(); Object mgr = _mgmtServer; switch (impl.manager()) {