Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a3937b1

Browse files
committed
Add descriptive error messages to logging
1 parent ab6828a commit a3937b1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/main/java/de/taimos/gpsd4java/backend/GPSdEndpoint.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public void start() {
113113
try {
114114
Thread.sleep(500);
115115
} catch (final InterruptedException e) {
116-
GPSdEndpoint.LOG.debug("", e);
116+
GPSdEndpoint.LOG.debug("Interrupted while sleeping", e);
117117
}
118118
}
119119

@@ -124,7 +124,7 @@ public void stop() {
124124
try {
125125
this.listenThread.halt();
126126
} catch (final Exception e) {
127-
GPSdEndpoint.LOG.debug("", e);
127+
GPSdEndpoint.LOG.debug("Interrupted while waiting for listenThread to stop", e);
128128
}
129129
this.listenThread = null;
130130
}
@@ -250,7 +250,7 @@ private IGPSObject waitForResult() {
250250
try {
251251
this.asyncWaitMutex.wait(1000);
252252
} catch (final InterruptedException e) {
253-
GPSdEndpoint.LOG.info("", e);
253+
GPSdEndpoint.LOG.info("Interrupted while waiting for result", e);
254254
}
255255
if (this.asnycResult != null) {
256256
return this.asnycResult;

src/main/java/de/taimos/gpsd4java/backend/SocketThread.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public void run() {
9090
break;
9191
} catch (final Exception e) {
9292
// TODO handle this better
93-
SocketThread.LOG.warn("", e);
93+
SocketThread.LOG.warn("Problem encountered while reading/parsing/handling line", e);
9494
}
9595
}
9696
}

src/test/java/de/taimos/gpsd4java/test/Tester.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public void handleDevices(final DevicesObject devices) {
127127

128128
Thread.sleep(60000);
129129
} catch (final Exception e) {
130-
Tester.log.error("", e);
130+
Tester.log.error("Problem encountered", e);
131131
}
132132
}
133133
}

0 commit comments

Comments
 (0)