Log exactly which part of the connection has died.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 18 Mar 2013 12:55:35 +0000 (13:55 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 18 Mar 2013 12:55:35 +0000 (13:55 +0100)
src/main/java/net/pterodactylus/sonitus/data/Connection.java

index 8ea1a55..169bfa5 100644 (file)
@@ -56,8 +56,14 @@ public abstract class Connection implements Runnable {
        @Override
        public void run() {
                while (true) {
+                       byte[] buffer = null;
+                       try {
+                               buffer = source.get(bufferSize());
+                       } catch (IOException ioe1) {
+                               logger.log(Level.WARNING, "Source died!", ioe1);
+                               break;
+                       }
                        try {
-                               byte[] buffer = source.get(bufferSize());
                                feed(buffer);
                        } catch (IOException ioe1) {
                                logger.log(Level.WARNING, "Sink died!", ioe1);