better error handling

This commit is contained in:
rusefi 2017-08-26 19:03:07 -04:00
parent 3951529763
commit c2a69713e7
2 changed files with 6 additions and 0 deletions

View File

@ -35,7 +35,12 @@ public class BinaryProtocolServer implements BinaryProtocolCommands {
ServerSocket serverSocket;
try {
serverSocket = new ServerSocket(PROXY_PORT, 1);
} catch (IOException e) {
FileLog.MAIN.logException("Error binding server socket", e);
return;
}
try {
while (true) {
// Wait for a connection
final Socket clientSocket = serverSocket.accept();

View File

@ -114,6 +114,7 @@ public enum FileLog {
public void logException(String msg, Throwable e) {
logLine(msg + e);
log(e);
e.printStackTrace();
}
}