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 4c5e3ab..148b33b 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);
         }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.