From 0cc06f68613dd22ed613846a438aa140936b7824 Mon Sep 17 00:00:00 2001 From: Tomas Cere Date: Wed, 16 Jan 2019 11:47:14 +0100 Subject: [PATCH] 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 --- .../restconf/common/errors/RestconfDocumentedException.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.36.6