From: Jozef Gloncak Date: Wed, 23 Jul 2014 11:55:21 +0000 (+0200) Subject: BUG 1144 - response 500 instead of 400 X-Git-Tag: release/helium~452 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=ce96c3361a25599956fba6e429c1f963219caed0 BUG 1144 - response 500 instead of 400 RestconfDocumentedException with error tag INVALID_VALUE (400) was caught and wrapped to RestconfDocumentedException with error tag OPERATION_FAILED (500) Change-Id: I0ad75958e0d8e25d5bf1bdf7cbac5f855cc2b03d Signed-off-by: Jozef Gloncak --- diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/rpc/impl/AbstractRpcExecutor.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/rpc/impl/AbstractRpcExecutor.java index 4c5e3ab530..148b33bd65 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/rpc/impl/AbstractRpcExecutor.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/rpc/impl/AbstractRpcExecutor.java @@ -37,6 +37,8 @@ public abstract class AbstractRpcExecutor implements RpcExecutor { throw new RestconfDocumentedException(e.getMessage(), ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE); } catch (UnsupportedOperationException e) { throw new RestconfDocumentedException(e.getMessage(), ErrorType.RPC, ErrorTag.OPERATION_NOT_SUPPORTED); + } catch (RestconfDocumentedException e) { + throw e; } catch (Exception e) { throw new RestconfDocumentedException("The operation encountered an unexpected error while executing.", e); }