From 9bcdfaa602a19df06d029a1642b53f5bc7a355dc Mon Sep 17 00:00:00 2001 From: flavien Date: Wed, 18 Mar 2020 16:18:35 +0100 Subject: [PATCH] added exceptions --- src/clientP2P/ClientManagementTCP.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/clientP2P/ClientManagementTCP.java b/src/clientP2P/ClientManagementTCP.java index 17e6a40..c7607a6 100644 --- a/src/clientP2P/ClientManagementTCP.java +++ b/src/clientP2P/ClientManagementTCP.java @@ -34,6 +34,7 @@ import protocolP2P.HashResponse; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import clientP2P.ClientDownloadTCP; +import exception.SocketClosed; /** Implementation of P2P-JAVA-PROJECT CLIENT * @author Louis Royer @@ -176,6 +177,9 @@ public class ClientManagementTCP implements Runnable { throw new ProtocolError(); } catch (EmptyFile e) { throw new ProtocolError(); + } catch (SocketClosed e){ + System.err.println("listDirectory : SocketClosed"); + throw new ProtocolError(); } }