API exception handling - print api command name to the log.

This commit is contained in:
alena 2010-11-19 15:44:33 -08:00
parent bb843ab1fb
commit a5dfaaf31b
1 changed files with 2 additions and 2 deletions

View File

@ -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