better logging for issues with declination service during heading correction in Igtimi receiver; catch and log exception per Igtimi listener

This commit is contained in:
Axel Uhl
2014-06-24 12:37:18 +02:00
parent 988c22d911
commit 26b41ae9ec
2 changed files with 13 additions and 3 deletions
@@ -378,8 +378,14 @@ public class IgtimiWindReceiver implements BulkFixReceiver {
if (declinationService == null) {
trueHeading = hdgm;
} else {
Declination declination = declinationService.getDeclination(timePoint, position, /* timeoutForOnlineFetchInMilliseconds 5s */ 5000);
trueHeading = hdgm.add(declination.getBearingCorrectedTo(timePoint));
try {
Declination declination = declinationService.getDeclination(timePoint, position, /* timeoutForOnlineFetchInMilliseconds 5s */ 5000);
trueHeading = hdgm.add(declination.getBearingCorrectedTo(timePoint));
} catch (Exception e) {
logger.log(Level.SEVERE, "Correction of declination was requested but unsuccessful. Can't correct heading "+
hdgm+"@"+timePoint+" by declination. Forwarding exception.");
throw e;
}
}
} else {
trueHeading = null;
@@ -154,7 +154,11 @@ public class WebSocketConnectionManager extends WebSocketAdapter implements Live
private void notifyListeners(List<Fix> fixes) {
for (BulkFixReceiver listener : listeners.keySet()) {
listener.received(fixes);
try {
listener.received(fixes);
} catch (Exception e) {
logger.log(Level.SEVERE, "Error notifying listener "+listener+" of Igtimi fixes "+fixes, e);
}
}
}