Browse Source

Adapt to Smack's silly exception structure.

Change-Id: I24aa53dc3941a32db9a8b80b54b91d977bba8fad
Fixes-issue: CLIENT-354
Reviewed-on: http://gerrit.dmdirc.com/2477
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
tags/0.7rc1
Chris Smith 12 years ago
parent
commit
65ab5f464c
1 changed files with 5 additions and 6 deletions
  1. 5
    6
      src/com/dmdirc/addons/parser_xmpp/XmppParser.java

+ 5
- 6
src/com/dmdirc/addons/parser_xmpp/XmppParser.java View File

@@ -47,7 +47,6 @@ import com.dmdirc.parser.interfaces.callbacks.PrivateMessageListener;
47 47
 import com.dmdirc.parser.interfaces.callbacks.ServerReadyListener;
48 48
 import com.dmdirc.parser.interfaces.callbacks.SocketCloseListener;
49 49
 
50
-import java.io.IOException;
51 50
 import java.net.URI;
52 51
 import java.util.Collection;
53 52
 import java.util.Collections;
@@ -58,6 +57,8 @@ import java.util.Map;
58 57
 import java.util.regex.Matcher;
59 58
 import java.util.regex.Pattern;
60 59
 
60
+import lombok.extern.slf4j.Slf4j;
61
+
61 62
 import org.jivesoftware.smack.Chat;
62 63
 import org.jivesoftware.smack.ChatManagerListener;
63 64
 import org.jivesoftware.smack.ConnectionConfiguration;
@@ -76,8 +77,6 @@ import org.jivesoftware.smackx.ChatStateListener;
76 77
 import org.jivesoftware.smackx.ChatStateManager;
77 78
 import org.jivesoftware.smackx.muc.MultiUserChat;
78 79
 
79
-import lombok.extern.slf4j.Slf4j;
80
-
81 80
 /**
82 81
  * A parser which can understand the XMPP protocol.
83 82
  */
@@ -508,10 +507,10 @@ public class XmppParser extends BaseSocketAwareParser {
508 507
 
509 508
             final ParserError error = new ParserError(ParserError.ERROR_ERROR, "Unable to connect", "");
510 509
 
511
-            if (ex.getCause() instanceof IOException) {
512
-                // Pass along the underlying socket error instead of an XMPP
510
+            if (ex.getWrappedThrowable() instanceof Exception) {
511
+                // Pass along the underlying exception instead of an XMPP
513 512
                 // specific one
514
-                error.setException((IOException) ex.getCause());
513
+                error.setException((Exception) ex.getWrappedThrowable());
515 514
             } else {
516 515
                 error.setException(ex);
517 516
             }

Loading…
Cancel
Save