mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-25 06:58:39 +00:00
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:
+8
-2
@@ -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;
|
||||
|
||||
+5
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user