Skip to content

Commit 95da86e

Browse files
author
Kris McQueen
committed
bug 6733: re-throw ServerApiExceptions when dispatching API commands rather than logging them and throwing a generic INTERNAL_ERROR exception
status 6733: resolved fixed
1 parent 90f10cd commit 95da86e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎server/src/com/cloud/api/ApiDispatcher.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ public void dispatch(BaseCmd cmd, Map<String, String> params) {
231231
throw new ServerApiException(BaseCmd.PARAM_ERROR, cause.getMessage());
232232
} else if (cause instanceof PermissionDeniedException) {
233233
throw new ServerApiException(BaseCmd.ACCOUNT_ERROR, cause.getMessage());
234+
} else if (cause instanceof ServerApiException) {
235+
throw (ServerApiException)cause;
234236
}
235237
s_logger.warn("Exception executing method " + methodName + " for command " + cmd.getClass().getSimpleName(), ite);
236238
throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Unable to execute method " + methodName + " for command " + cmd.getClass().getSimpleName() + ", internal error in the implementation.");

0 commit comments

Comments
 (0)