From cc16ccf317abf039524cf46603eaba18f7b2a5d2 Mon Sep 17 00:00:00 2001 From: flavien Date: Wed, 18 Mar 2020 16:10:45 +0100 Subject: [PATCH] added exceptions --- src/clientP2P/ClientDownloadTCP.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/clientP2P/ClientDownloadTCP.java b/src/clientP2P/ClientDownloadTCP.java index a5bb718..1951248 100644 --- a/src/clientP2P/ClientDownloadTCP.java +++ b/src/clientP2P/ClientDownloadTCP.java @@ -29,6 +29,7 @@ import java.io.File; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.nio.file.StandardCopyOption; +import exception.SocketClosed; /** Class to download file from tcp * @author Louis Royer @@ -216,6 +217,8 @@ public class ClientDownloadTCP implements Runnable { return hash; } catch (IOException e) { throw new InternalError(); + } catch (SocketClosed e){ + system.err.println("getHashSum512 : SocketClosed"); } } @@ -336,6 +339,8 @@ public class ClientDownloadTCP implements Runnable { } } catch (IOException e) { throw new InternalError(); + } catch (SocketClosed e){ + system.err.println("setSize : SocketClosed"); } }