From 95da86ef1a871dc5cc8b92cfa0cd7abcae162456 Mon Sep 17 00:00:00 2001 From: Kris McQueen Date: Tue, 26 Oct 2010 16:54:31 -0700 Subject: [PATCH] bug 6733: re-throw ServerApiExceptions when dispatching API commands rather than logging them and throwing a generic INTERNAL_ERROR exception status 6733: resolved fixed --- server/src/com/cloud/api/ApiDispatcher.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java index 822a7cdee17..d518eed714e 100644 --- a/server/src/com/cloud/api/ApiDispatcher.java +++ b/server/src/com/cloud/api/ApiDispatcher.java @@ -231,6 +231,8 @@ public class ApiDispatcher { throw new ServerApiException(BaseCmd.PARAM_ERROR, cause.getMessage()); } else if (cause instanceof PermissionDeniedException) { throw new ServerApiException(BaseCmd.ACCOUNT_ERROR, cause.getMessage()); + } else if (cause instanceof ServerApiException) { + throw (ServerApiException)cause; } s_logger.warn("Exception executing method " + methodName + " for command " + cmd.getClass().getSimpleName(), ite); throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Unable to execute method " + methodName + " for command " + cmd.getClass().getSimpleName() + ", internal error in the implementation.");