From: David ‘Bombe’ Roden Date: Mon, 19 May 2008 08:39:42 +0000 (+0000) Subject: add not-conncted exception X-Git-Tag: v0.1.1~122 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=72fa147608d530a273c8165d2036e6fc1b8511a1;p=jFCPlib.git add not-conncted exception git-svn-id: http://trooper/svn/projects/jFCPlib/branch/high-level-client@917 c3eda9e8-030b-0410-8277-bc7414b0a119 --- diff --git a/src/net/pterodactylus/fcp/highlevel/HighLevelClient.java b/src/net/pterodactylus/fcp/highlevel/HighLevelClient.java index e263454..14aa5f3 100644 --- a/src/net/pterodactylus/fcp/highlevel/HighLevelClient.java +++ b/src/net/pterodactylus/fcp/highlevel/HighLevelClient.java @@ -533,13 +533,13 @@ public class HighLevelClient { * Checks whether the client is already connected and throws an exception if * it is not. * - * @throws HighLevelException + * @throws NotConnectedException * if the client is not connected */ - private void checkConnection() throws HighLevelException { + private void checkConnection() throws NotConnectedException { synchronized (this) { if (fcpConnection == null) { - throw new HighLevelException("client is not connected"); + throw new NotConnectedException("client is not connected"); } } } diff --git a/src/net/pterodactylus/fcp/highlevel/NotConnectedException.java b/src/net/pterodactylus/fcp/highlevel/NotConnectedException.java new file mode 100644 index 0000000..9902591 --- /dev/null +++ b/src/net/pterodactylus/fcp/highlevel/NotConnectedException.java @@ -0,0 +1,54 @@ +/** + * + */ +package net.pterodactylus.fcp.highlevel; + +/** + * Exception that is thrown when an operation is tried on a not connected + * connection. + * + * @author David Roden + * @version $Id$ + */ +public class NotConnectedException extends HighLevelException { + + /** + * Creates a new not-connected exception. + */ + public NotConnectedException() { + super(); + } + + /** + * Creates a new not-connected exception with the given message. + * + * @param message + * The message of the exception + */ + public NotConnectedException(String message) { + super(message); + } + + /** + * Creates a new not-connected exception with the given cause. + * + * @param cause + * The cause of the exception + */ + public NotConnectedException(Throwable cause) { + super(cause); + } + + /** + * Creates a new not-connected exception with the given message and cause. + * + * @param message + * The message of the exception + * @param cause + * The cause of the exception + */ + public NotConnectedException(String message, Throwable cause) { + super(message, cause); + } + +}