From ce96c3361a25599956fba6e429c1f963219caed0 Mon Sep 17 00:00:00 2001 From: Jozef Gloncak Date: Wed, 23 Jul 2014 13:55:21 +0200 Subject: [PATCH] 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 --- .../controller/sal/restconf/rpc/impl/AbstractRpcExecutor.java | 2 ++ 1 file changed, 2 insertions(+) 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); } -- 2.36.6