From 0a1cce3127eeb540a541d3fc30c50ce806da853b Mon Sep 17 00:00:00 2001 From: js Date: Sat, 11 Apr 2020 15:30:34 +0200 Subject: [PATCH] added ErrorFrame support --- src/gui/ClientInterfaceGUI.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/ClientInterfaceGUI.java b/src/gui/ClientInterfaceGUI.java index 76f819b..58486ce 100644 --- a/src/gui/ClientInterfaceGUI.java +++ b/src/gui/ClientInterfaceGUI.java @@ -72,29 +72,38 @@ public class ClientInterfaceGUI extends ClientInterface { win.setVisible(true); } catch (EmptyDirectory e) { writeLog("Server has no file in directory", LogLevel.Error); + ErrorFrame err = new ErrorFrame("Server has no file in directory"); } catch (InternalError e) { writeLog("Client internal error", LogLevel.Error); + ErrorFrame err = new ErrorFrame("Client internal error"); } catch (UnknownHostException e) { writeLog("Server host is unknown", LogLevel.Error); + ErrorFrame err = new ErrorFrame("Server host is unknown"); } catch (IOException e) { writeLog("Request cannot be send or response cannot be received", LogLevel.Error); + ErrorFrame err = new ErrorFrame("Request cannot be send or response cannot be received"); } catch (TransmissionError e) { writeLog("Message received is too big", LogLevel.Error); + ErrorFrame err = new ErrorFrame("Message received is too big"); } catch (ProtocolError e) { writeLog("Cannot decode server’s response", LogLevel.Error); + ErrorFrame err = new ErrorFrame("Cannot decode server’s response"); } catch (VersionError e) { writeLog("Server’s response use bad version of the protocol", LogLevel.Error); + ErrorFrame err = new ErrorFrame("Server’s response use bad version of the protocol"); } catch (SizeError e) { writeLog("Cannot handle this packets because of internal representation limitations of numbers on the client", LogLevel.Error); + ErrorFrame err = new ErrorFrame("Cannot handle this packets because of internal representation limitations of numbers on the client"); } catch (InternalRemoteError e) { writeLog("Server internal error", LogLevel.Error); + ErrorFrame err = new ErrorFrame("Server internal error"); } catch (ProtocolRemoteError e) { writeLog("Server cannot decode client’s request", LogLevel.Error); + ErrorFrame err = new ErrorFrame("Server cannot decode client’s request"); } catch (VersionRemoteError e) { writeLog("Server cannot decode this version of the protocol", LogLevel.Error); - - + ErrorFrame err = new ErrorFrame("Server cannot decode this version of the protocol"); } } }