summaryrefslogtreecommitdiffstats
path: root/jack-server/src/com
diff options
context:
space:
mode:
authormikaelpeltier <mikaelpeltier@google.com>2015-04-15 09:58:40 +0200
committermikaelpeltier <mikaelpeltier@google.com>2015-04-15 09:58:40 +0200
commitdbdbc0554d6cdf9314062bdf412a4cdbcf3acf69 (patch)
treeecac5b245299186bba99f2fbf60c6c32ebf8d646 /jack-server/src/com
parente251e99d0dae14ab91e47c6c2d6cd66d8844bd5c (diff)
downloadtoolchain_jack-dbdbc0554d6cdf9314062bdf412a4cdbcf3acf69.zip
toolchain_jack-dbdbc0554d6cdf9314062bdf412a4cdbcf3acf69.tar.gz
toolchain_jack-dbdbc0554d6cdf9314062bdf412a4cdbcf3acf69.tar.bz2
Modify how connection errors are reported
Change-Id: I0f614502faf6cf3f38aa629a81569dc338d12a0f
Diffstat (limited to 'jack-server/src/com')
-rw-r--r--jack-server/src/com/android/jack/server/JackSimpleServer.java13
1 files changed, 11 insertions, 2 deletions
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();
}
}