added ErrorFrame support

pull/108/head
js 5 years ago
parent 6331f9f144
commit 0a1cce3127

@ -72,29 +72,38 @@ public class ClientInterfaceGUI extends ClientInterface {
win.setVisible(true); win.setVisible(true);
} catch (EmptyDirectory e) { } catch (EmptyDirectory e) {
writeLog("Server has no file in directory", LogLevel.Error); writeLog("Server has no file in directory", LogLevel.Error);
ErrorFrame err = new ErrorFrame("Server has no file in directory");
} }
catch (InternalError e) { catch (InternalError e) {
writeLog("Client internal error", LogLevel.Error); writeLog("Client internal error", LogLevel.Error);
ErrorFrame err = new ErrorFrame("Client internal error");
} catch (UnknownHostException e) { } catch (UnknownHostException e) {
writeLog("Server host is unknown", LogLevel.Error); writeLog("Server host is unknown", LogLevel.Error);
ErrorFrame err = new ErrorFrame("Server host is unknown");
} catch (IOException e) { } catch (IOException e) {
writeLog("Request cannot be send or response cannot be received", LogLevel.Error); 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) { } catch (TransmissionError e) {
writeLog("Message received is too big", LogLevel.Error); writeLog("Message received is too big", LogLevel.Error);
ErrorFrame err = new ErrorFrame("Message received is too big");
} catch (ProtocolError e) { } catch (ProtocolError e) {
writeLog("Cannot decode servers response", LogLevel.Error); writeLog("Cannot decode servers response", LogLevel.Error);
ErrorFrame err = new ErrorFrame("Cannot decode servers response");
} catch (VersionError e) { } catch (VersionError e) {
writeLog("Servers response use bad version of the protocol", LogLevel.Error); writeLog("Servers response use bad version of the protocol", LogLevel.Error);
ErrorFrame err = new ErrorFrame("Servers response use bad version of the protocol");
} catch (SizeError e) { } catch (SizeError e) {
writeLog("Cannot handle this packets because of internal representation limitations of numbers on the client", LogLevel.Error); 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) { } catch (InternalRemoteError e) {
writeLog("Server internal error", LogLevel.Error); writeLog("Server internal error", LogLevel.Error);
ErrorFrame err = new ErrorFrame("Server internal error");
} catch (ProtocolRemoteError e) { } catch (ProtocolRemoteError e) {
writeLog("Server cannot decode clients request", LogLevel.Error); writeLog("Server cannot decode clients request", LogLevel.Error);
ErrorFrame err = new ErrorFrame("Server cannot decode clients request");
} catch (VersionRemoteError e) { } catch (VersionRemoteError e) {
writeLog("Server cannot decode this version of the protocol", LogLevel.Error); writeLog("Server cannot decode this version of the protocol", LogLevel.Error);
ErrorFrame err = new ErrorFrame("Server cannot decode this version of the protocol");
} }
} }
} }

Loading…
Cancel
Save