X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fapi%2FNetconfDocumentedException.java;h=57bd3dd6209d3248dc7c7b969ccaf6f5a33fbbf7;hb=6dae254dbc2940d1f0f372d65d69b0e0dda415fe;hp=ceeca51defdff65016a842faaa97bfcdc165d6ae;hpb=32275b7cbe98c361f08970eff34ecb721f45c9e4;p=controller.git diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfDocumentedException.java b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfDocumentedException.java index ceeca51def..57bd3dd620 100644 --- a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfDocumentedException.java +++ b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfDocumentedException.java @@ -90,6 +90,12 @@ public class NetconfDocumentedException extends Exception { this.errorInfo = errorInfo; } + public static NetconfDocumentedException wrap(E exception) throws NetconfDocumentedException { + final Map errorInfo = new HashMap<>(); + errorInfo.put(ErrorTag.operation_failed.name(), "Exception thrown"); + throw new NetconfDocumentedException(exception.getMessage(), exception, ErrorType.application, ErrorTag.operation_failed, + ErrorSeverity.error, errorInfo); + } public static NetconfDocumentedException wrap(ValidationException e) throws NetconfDocumentedException { final Map errorInfo = new HashMap<>(); errorInfo.put(ErrorTag.operation_failed.name(), "Validation failed");