X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2FRestconfImpl.java;h=5e9ab7b9d0a0b818a577ddbcec502f10e6196bca;hb=f412b1da773035f89f5c686ef8a849d084752cb6;hp=1514a15d1132417849a0efb29e53b0ea26113b8f;hpb=107324809285bfbb9890cba38ffa18390f8de4bd;p=controller.git 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); } }