Replaced the catches of Throwable with catches of Exception

This commit is contained in:
Lennart Hensler
2013-01-25 10:28:07 +01:00
parent f4bc38dea5
commit 311576db6e
20 changed files with 112 additions and 112 deletions
@@ -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);
@@ -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;
}