From a5dfaaf31b07f7b856381d4536a26e808a58967b Mon Sep 17 00:00:00 2001 From: alena Date: Fri, 19 Nov 2010 15:44:33 -0800 Subject: [PATCH] API exception handling - print api command name to the log. --- server/src/com/cloud/api/ApiDispatcher.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java index 090c6d80605..d0f63e337ec 100644 --- a/server/src/com/cloud/api/ApiDispatcher.java +++ b/server/src/com/cloud/api/ApiDispatcher.java @@ -81,7 +81,7 @@ public class ApiDispatcher { }else if (t instanceof ServerApiException) { throw new ServerApiException(((ServerApiException) t).getErrorCode(), ((ServerApiException) t).getDescription()); }else { - s_logger.error("Exception while executing " + cmd.getName() + ":", t); + s_logger.error("Exception while executing " + cmd.getClass().getSimpleName() + ":", t); if (UserContext.current().getAccount() == null || UserContext.current().getAccount().getType() == Account.ACCOUNT_TYPE_ADMIN) throw new ServerApiException(BaseCmd.INTERNAL_ERROR, t.getMessage()); else @@ -110,7 +110,7 @@ public class ApiDispatcher { }else if (t instanceof ServerApiException) { throw new ServerApiException(((ServerApiException) t).getErrorCode(), ((ServerApiException) t).getDescription()); } else { - s_logger.error("Exception while executing " + cmd.getName() + ":", t); + s_logger.error("Exception while executing " + cmd.getClass().getSimpleName() + ":", t); if (UserContext.current().getAccount() == null || UserContext.current().getAccount().getType() == Account.ACCOUNT_TYPE_ADMIN) throw new ServerApiException(BaseCmd.INTERNAL_ERROR, t.getMessage()); else