From: Tomas Cere Date: Wed, 16 Jan 2019 10:47:14 +0000 (+0100) Subject: Propagate error status codes correctly X-Git-Tag: release/fluorine-sr2~11^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=0cc06f68613dd22ed613846a438aa140936b7824;p=netconf.git Propagate error status codes correctly All RestconfDocumentedExceptions were being incorrectly reported with status code 50x since the status code was not correctly forwared to the underlying WebApplicationException. Change-Id: Ibe53c560053607abff665a2f36a524dece51a2fc JIRA: NETCONF-511 Signed-off-by: Tomas Cere --- diff --git a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfDocumentedException.java b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfDocumentedException.java index 3f1f458fb3..fc1773e86d 100644 --- a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfDocumentedException.java +++ b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfDocumentedException.java @@ -156,7 +156,7 @@ public class RestconfDocumentedException extends WebApplicationException { } public RestconfDocumentedException(final Throwable cause, final RestconfError error) { - super(cause); + super(cause, error.getErrorTag().getStatusCode()); Preconditions.checkNotNull(error, "RestconfError can't be null"); errors = ImmutableList.of(error); status = null;