Catch exceptions when trying to join channels.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 10 Aug 2013 20:54:45 +0000 (22:54 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 10 Aug 2013 20:54:45 +0000 (22:54 +0200)
src/main/java/net/pterodactylus/xdcc/core/Core.java

index e2710e4..240beb1 100644 (file)
@@ -345,7 +345,11 @@ public class Core extends AbstractExecutionThreadService {
                                Connection connection = networkConnections.get(channel.network());
                                if (connection.established()) {
                                        eventBus.post(new GenericMessage(String.format("Trying to join %s on %s.", channel.name(), channel.network().name())));
-                                       connection.joinChannel(channel.name());
+                                       try {
+                                               connection.joinChannel(channel.name());
+                                       } catch (IOException ioe1) {
+                                               eventBus.post(new GenericMessage(String.format("Could not join %s on %s.", channel.name(), channel.network().name())));
+                                       }
                                }
                        }
                }