Send message when a connection fails.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 13 Jan 2015 17:36:56 +0000 (18:36 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 13 Jan 2015 17:36:56 +0000 (18:36 +0100)
src/main/java/net/pterodactylus/xdcc/core/Core.java

index 30da4a8..ded98cf 100644 (file)
@@ -536,6 +536,7 @@ public class Core extends AbstractExecutionThreadService {
        @Subscribe
        public void connectionClosed(ConnectionClosed connectionClosed) {
                removeConnection(connectionClosed.connection());
+               eventBus.post(new GenericMessage(String.format("Connection closed by %s.", connectionClosed.connection().hostname())));
        }
 
        /**
@@ -547,6 +548,7 @@ public class Core extends AbstractExecutionThreadService {
        @Subscribe
        public void connectionFailed(ConnectionFailed connectionFailed) {
                removeConnection(connectionFailed.connection());
+               eventBus.post(new GenericMessage(String.format("Could not connect to %s: %s.", connectionFailed.connection().hostname(), connectionFailed.cause())));
        }
 
        /**