add not-conncted exception
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Mon, 19 May 2008 08:39:42 +0000 (08:39 +0000)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Mon, 19 May 2008 08:39:42 +0000 (08:39 +0000)
git-svn-id: http://trooper/svn/projects/jFCPlib/branch/high-level-client@917 c3eda9e8-030b-0410-8277-bc7414b0a119

src/net/pterodactylus/fcp/highlevel/HighLevelClient.java
src/net/pterodactylus/fcp/highlevel/NotConnectedException.java [new file with mode: 0644]

index e263454..14aa5f3 100644 (file)
@@ -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 (file)
index 0000000..9902591
--- /dev/null
@@ -0,0 +1,54 @@
+/**
+ * 
+ */
+package net.pterodactylus.fcp.highlevel;
+
+/**
+ * Exception that is thrown when an operation is tried on a not connected
+ * connection.
+ * 
+ * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
+ * @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);
+       }
+
+}