diff --git a/src/main/java/ClientHandler.java b/src/main/java/ClientHandler.java index 9c52f54..3b30c32 100644 --- a/src/main/java/ClientHandler.java +++ b/src/main/java/ClientHandler.java @@ -1,4 +1,6 @@ + import java.io.BufferedReader; + import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; @@ -38,10 +40,10 @@ public class ClientHandler implements Runnable { message = fromClientReader.readLine(); } } catch (IOException e) { - e.printStackTrace(); + throw new RuntimeException(e); + } finally { //chatServer.removeClient(this); - throw new RuntimeException(e); chatServer.broadcastMessage(name + " disconnected."); if (fromClientReader != null) {