Send connection closed event when a runtime exception occurs.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 2 May 2013 19:06:49 +0000 (21:06 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 2 May 2013 19:06:49 +0000 (21:06 +0200)
src/main/java/net/pterodactylus/irc/Connection.java

index 15dde44..b67b8db 100644 (file)
@@ -511,6 +511,9 @@ public class Connection extends AbstractExecutionThreadService implements Servic
                } catch (IOException ioe1) {
                        logger.log(Level.WARNING, "I/O error", ioe1);
                        eventBus.post(new ConnectionClosed(this, ioe1));
+               } catch (RuntimeException re1) {
+                       logger.log(Level.SEVERE, "Runtime error", re1);
+                       eventBus.post(new ConnectionClosed(this, re1));
                } finally {
                        established = false;
                        logger.info("Closing Connection.");