From: Robert Varga Date: Tue, 20 Jul 2021 11:09:07 +0000 (+0200) Subject: Log full exception when we are missing errors X-Git-Tag: v1.13.4~7 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=09a93bb34b510e32b17ea6b73ea1e66ef65bf731;p=netconf.git Log full exception when we are missing errors Our current logging does not identify the source of the offending exception. Make sure we log the entire input exception, so that offenders may be fixed up. JIRA: NETCONF-789 Change-Id: I30a24a615ce221a838e1ad95f6b11263e2d6f8f5 Signed-off-by: Robert Varga (cherry picked from commit 8dc035c90ba706efceb66ced5fa51408b4c494f9) --- diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/errors/RestconfDocumentedExceptionMapper.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/errors/RestconfDocumentedExceptionMapper.java index 2f525b81f7..8dfafd78b2 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/errors/RestconfDocumentedExceptionMapper.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/errors/RestconfDocumentedExceptionMapper.java @@ -96,10 +96,9 @@ public final class RestconfDocumentedExceptionMapper implements ExceptionMapper< if (responseStatus != Response.Status.FORBIDDEN && responseStatus.getFamily() == Response.Status.Family.CLIENT_ERROR && exception.getErrors().isEmpty()) { - // there should be at least one error entry for 4xx errors except 409 according to the RFC 8040 - // - creation of WARN log that something went wrong way on the server side - LOG.warn("Input exception has a family of 4xx but doesn't contain any descriptive errors: {}", - exception.getMessage()); + // There should be at least one error entry for 4xx errors except 409 according to RFC8040, but we do not + // have it. Issue a warning with the call trace so we can fix whoever was the originator. + LOG.warn("Input exception has a family of 4xx but does not contain any descriptive errors", exception); } final ContainerNode errorsContainer = buildErrorsContainer(exception); @@ -384,4 +383,4 @@ public final class RestconfDocumentedExceptionMapper implements ExceptionMapper< void setHttpHeaders(final HttpHeaders httpHeaders) { this.headers = httpHeaders; } -} \ No newline at end of file +}