mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-30 09:26:44 +00:00
Replaced the catches of Throwable with catches of Exception
This commit is contained in:
+6
-6
@@ -287,19 +287,19 @@ public class StoreAndForward implements Runnable {
|
||||
try {
|
||||
// TODO if forwarding to os doesn't work, e.g., because the socket was closed or the client died, remove os from streamsToForwardTo and the socket from socketsToForwardTo
|
||||
transceiver.sendMessage(message, os);
|
||||
} catch (Throwable e) {
|
||||
} catch (Exception e) {
|
||||
int i=streamsToForwardTo.indexOf(os);
|
||||
try {
|
||||
os.close();
|
||||
} catch (Throwable t) {
|
||||
logger.throwing(StoreAndForward.class.getName(), "run", t);
|
||||
} catch (Exception exc) {
|
||||
logger.throwing(StoreAndForward.class.getName(), "run", exc);
|
||||
}
|
||||
streamsToForwardTo.remove(os);
|
||||
Socket s = socketsToForwardTo.remove(i);
|
||||
try {
|
||||
s.close();
|
||||
} catch (Throwable t) {
|
||||
logger.throwing(StoreAndForward.class.getName(), "run", t);
|
||||
} catch (Exception exc) {
|
||||
logger.throwing(StoreAndForward.class.getName(), "run", exc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -314,7 +314,7 @@ public class StoreAndForward implements Runnable {
|
||||
for (Socket socketToForwardTo : socketsToForwardTo) {
|
||||
socketToForwardTo.close();
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (!stopped) {
|
||||
logger.throwing(StoreAndForward.class.getName(), "Error during forwarding message. Continuing...", e);
|
||||
|
||||
+4
-4
@@ -83,11 +83,11 @@ public class SwissTimingAdapterPersistenceImpl implements SwissTimingAdapterPers
|
||||
result.add(stConfig);
|
||||
}
|
||||
Collections.reverse(result);
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
// something went wrong during DB access; report, then use empty new wind track
|
||||
logger.log(Level.SEVERE,
|
||||
"Error connecting to MongoDB, unable to load recorded SwissTiming configurations. Check MongoDB settings.");
|
||||
logger.throwing(SwissTimingAdapterPersistenceImpl.class.getName(), "getSwissTimingConfigurations", t);
|
||||
logger.throwing(SwissTimingAdapterPersistenceImpl.class.getName(), "getSwissTimingConfigurations", e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -109,11 +109,11 @@ public class SwissTimingAdapterPersistenceImpl implements SwissTimingAdapterPers
|
||||
result.add(stConfig);
|
||||
}
|
||||
Collections.reverse(result);
|
||||
} catch (Throwable t) {
|
||||
} catch (Exception e) {
|
||||
// something went wrong during DB access; report, then use empty new wind track
|
||||
logger.log(Level.SEVERE,
|
||||
"Error connecting to MongoDB, unable to load recorded SwissTiming archive configurations. Check MongoDB settings.");
|
||||
logger.throwing(SwissTimingAdapterPersistenceImpl.class.getName(), "getSwissTimingArchiveConfigurations", t);
|
||||
logger.throwing(SwissTimingAdapterPersistenceImpl.class.getName(), "getSwissTimingArchiveConfigurations", e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user