X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2FRestconfImpl.java;h=5e9ab7b9d0a0b818a577ddbcec502f10e6196bca;hp=1514a15d1132417849a0efb29e53b0ea26113b8f;hb=1447e0132075bbd3013aa41b98384a373bd82d1a;hpb=b4713ee2aa4dc2d7a88fb3f972b9e69eeb185b14 diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.java index 1514a15d11..5e9ab7b9d0 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfImpl.java @@ -417,18 +417,13 @@ public class RestconfImpl implements RestconfService { return retValue; } throw new RestconfDocumentedException("RpcError message", null, retValue.getErrors()); - } - catch (final InterruptedException e) { + } catch (final InterruptedException e) { throw new RestconfDocumentedException( "The operation was interrupted while executing and did not complete.", ErrorType.RPC, ErrorTag.PARTIAL_OPERATION); - } - catch (final ExecutionException e) { + } catch (final ExecutionException e) { Throwable cause = e.getCause(); - if (cause instanceof CancellationException) { - throw new RestconfDocumentedException("The operation was cancelled while executing.", ErrorType.RPC, - ErrorTag.PARTIAL_OPERATION); - } else if (cause != null) { + if (cause != null) { while (cause.getCause() != null) { cause = cause.getCause(); } @@ -444,6 +439,9 @@ public class RestconfImpl implements RestconfService { throw new RestconfDocumentedException("The operation encountered an unexpected error while executing.", e); } + } catch (final CancellationException e) { + throw new RestconfDocumentedException("The operation was cancelled while executing.", ErrorType.RPC, + ErrorTag.PARTIAL_OPERATION); } }