initial quantum version
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / model / ConnectionException.java
diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/ConnectionException.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/model/ConnectionException.java
new file mode 100644 (file)
index 0000000..f1da0bf
--- /dev/null
@@ -0,0 +1,56 @@
+package com.quantum.model;
+
+/**
+ * @author BC
+ */
+public class ConnectionException extends Exception {
+
+    private Throwable cause = null;
+
+    /**
+     * 
+     */
+    public ConnectionException() {
+        super();
+    }
+
+    /**
+     * @param message
+     */
+    public ConnectionException(String message) {
+        super(message);
+    }
+
+    /**
+     * @param message
+     * @param cause
+     */
+    public ConnectionException(String message, Throwable cause) {
+        super(message);
+        this.cause = cause;
+    }
+
+    /**
+     * @param cause
+     */
+    public ConnectionException(Throwable cause) {
+        super(cause.getMessage());
+        this.cause = cause;
+    }
+
+    public Throwable getCause() {
+        return this.cause;
+    }
+
+    public String toString() {
+        String base = super.toString();
+        if (this.cause != null) {
+            base += System.getProperty("line.separator")
+                + "Root cause:"
+                + System.getProperty("line.separator")
+                + this.cause.toString();
+        }
+        return base;
+    }
+
+}