better error handling

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

View File

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

View File

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