BUG 1144 - response 500 instead of 400 57/9257/1
authorJozef Gloncak <jgloncak@cisco.com>
Wed, 23 Jul 2014 11:55:21 +0000 (13:55 +0200)
committerJozef Gloncak <jgloncak@cisco.com>
Wed, 23 Jul 2014 11:55:27 +0000 (13:55 +0200)
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 <jgloncak@cisco.com>
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/rpc/impl/AbstractRpcExecutor.java

index 4c5e3ab5301e0dc1fa4f27507030bc479f49a012..148b33bd6545ffe544418ddc6b393258535c5c9a 100644 (file)
@@ -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);
         }