X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Ftools%2Fnetconf-cli%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fcli%2Fcommands%2FCommandInvocationException.java;fp=opendaylight%2Fnetconf%2Ftools%2Fnetconf-cli%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fcli%2Fcommands%2FCommandInvocationException.java;h=e38f45f5ad11aac1cacb20c8dbba9ac7bb6f3d47;hb=23fe9ca678ada6263fec5dd996f4025e4a32fcf5;hp=0000000000000000000000000000000000000000;hpb=071a641d7c12c0e6112d5ce0afe806b54f116ed2;p=controller.git diff --git a/opendaylight/netconf/tools/netconf-cli/src/main/java/org/opendaylight/controller/netconf/cli/commands/CommandInvocationException.java b/opendaylight/netconf/tools/netconf-cli/src/main/java/org/opendaylight/controller/netconf/cli/commands/CommandInvocationException.java new file mode 100644 index 0000000000..e38f45f5ad --- /dev/null +++ b/opendaylight/netconf/tools/netconf-cli/src/main/java/org/opendaylight/controller/netconf/cli/commands/CommandInvocationException.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.netconf.cli.commands; + +import org.opendaylight.yangtools.yang.common.QName; + +public class CommandInvocationException extends Exception { + + public CommandInvocationException(final QName qName, final Throwable cause) { + this("Command " + qName + " invocation failed: " + cause.getMessage(), cause); + } + + protected CommandInvocationException(final String message, final Throwable cause) { + super(message, cause); + } + + public static class CommandTimeoutException extends CommandInvocationException { + + public CommandTimeoutException(final QName qName, final Throwable e) { + super("Command " + qName + " timed out: " + e.getMessage(), e); + } + } +}