From c53aae6dc81a5e0b76320d342169366995da140b Mon Sep 17 00:00:00 2001 From: Ryan Goulding Date: Wed, 7 Feb 2018 14:11:37 -0500 Subject: [PATCH] AAA-158: remove exception output in HTTP response Change-Id: Icb3c2cfcf1d546bb365fb61d558cd3be428e5a15 Signed-off-by: Ryan Goulding --- .../main/java/org/opendaylight/aaa/api/model/IDMError.java | 4 ++++ .../main/java/org/opendaylight/aaa/shiro/idm/UserHandler.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/aaa-authn-api/src/main/java/org/opendaylight/aaa/api/model/IDMError.java b/aaa-authn-api/src/main/java/org/opendaylight/aaa/api/model/IDMError.java index 8cd7003fa..d12425bcf 100644 --- a/aaa-authn-api/src/main/java/org/opendaylight/aaa/api/model/IDMError.java +++ b/aaa-authn-api/src/main/java/org/opendaylight/aaa/api/model/IDMError.java @@ -37,6 +37,10 @@ public class IDMError { details = msgDetails; } + public IDMError(int statusCode, String msg) { + this(statusCode, msg, ""); + } + public String getMessage() { return message; } diff --git a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/idm/UserHandler.java b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/idm/UserHandler.java index 1a1d376b0..2a031cd74 100644 --- a/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/idm/UserHandler.java +++ b/aaa-shiro/impl/src/main/java/org/opendaylight/aaa/shiro/idm/UserHandler.java @@ -331,12 +331,12 @@ public class UserHandler { * @param verbal * such as "creating", "deleting", "updating" * @param ex - * The exception, which is propagated in the response + * The exception, which is logged locally * @return A response containing internal error with specific reasoning */ private Response internalError(final String verbal, final Exception ex) { LOG.error("There was an internal error {} the user", verbal, ex); - return new IDMError(500, String.format("There was an internal error %s the user", verbal), ex.getMessage()) + return new IDMError(500, String.format("There was an internal error %s the user", verbal)) .response(); } -- 2.36.6