From d72a8d36fc0d97c3ddba049b6fa85c3a69fd7118 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 2 May 2013 21:06:49 +0200 Subject: [PATCH 1/1] Send connection closed event when a runtime exception occurs. --- src/main/java/net/pterodactylus/irc/Connection.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/net/pterodactylus/irc/Connection.java b/src/main/java/net/pterodactylus/irc/Connection.java index 15dde44..b67b8db 100644 --- a/src/main/java/net/pterodactylus/irc/Connection.java +++ b/src/main/java/net/pterodactylus/irc/Connection.java @@ -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."); -- 2.7.4