X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcds-access-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fconcepts%2FRequestException.java;h=4f2a0585da76c9afe04b0a5c744faf4c22138eba;hb=refs%2Fchanges%2F20%2F55720%2F2;hp=f3b3d734212ed5daab539f07dff0bb242ed30a7b;hpb=93fd87f9e46446be9eb8538669ebbfade205590e;p=controller.git diff --git a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/RequestException.java b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/RequestException.java index f3b3d73421..4f2a0585da 100644 --- a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/RequestException.java +++ b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/RequestException.java @@ -24,9 +24,19 @@ public abstract class RequestException extends Exception { super(Preconditions.checkNotNull(message)); } - protected RequestException(@Nonnull final String message, @Nonnull final Exception cause) { + protected RequestException(@Nonnull final String message, @Nonnull final Throwable cause) { super(Preconditions.checkNotNull(message), Preconditions.checkNotNull(cause)); } public abstract boolean isRetriable(); + + /** + * Unwraps the underlying failure. This method is overridden only in {@link RuntimeRequestException}. + * + * @return Underlying cause of the failure if exception is a {@link RuntimeRequestException}, or the exception + * itself. + */ + public Throwable unwrap() { + return this; + } }