From dbdbc0554d6cdf9314062bdf412a4cdbcf3acf69 Mon Sep 17 00:00:00 2001 From: mikaelpeltier Date: Wed, 15 Apr 2015 09:58:40 +0200 Subject: Modify how connection errors are reported Change-Id: I0f614502faf6cf3f38aa629a81569dc338d12a0f --- .../src/com/android/jack/server/JackSimpleServer.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'jack-server/src/com') diff --git a/jack-server/src/com/android/jack/server/JackSimpleServer.java b/jack-server/src/com/android/jack/server/JackSimpleServer.java index 506970e..67c69e8 100644 --- a/jack-server/src/com/android/jack/server/JackSimpleServer.java +++ b/jack-server/src/com/android/jack/server/JackSimpleServer.java @@ -56,6 +56,7 @@ import java.lang.management.MemoryUsage; import java.lang.management.OperatingSystemMXBean; import java.lang.management.RuntimeMXBean; import java.lang.reflect.Method; +import java.net.BindException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.UnknownHostException; @@ -237,7 +238,11 @@ public class JackSimpleServer { assert adminConnection != null; adminConnection.connect(adminSocket); } catch (IOException e) { - logger.log(Level.SEVERE, "Problem during admin connection ", e); + if (e.getCause() instanceof BindException) { + logger.log(Level.SEVERE, "Problem during service connection: " + e.getCause().getMessage()); + } else { + logger.log(Level.SEVERE, "Problem during service connection ", e); + } abort(); } @@ -252,7 +257,11 @@ public class JackSimpleServer { serviceConnection.connect(serviceSocket); startTimer(); } catch (IOException e) { - logger.log(Level.SEVERE, "Problem during service connection ", e); + if (e.getCause() instanceof BindException) { + logger.log(Level.SEVERE, "Problem during service connection: " + e.getCause().getMessage()); + } else { + logger.log(Level.SEVERE, "Problem during service connection ", e); + } abort(); } } -- cgit v1.1