From 90e033d2acfe959ed3fc5a55a00b6a035ccb81ba Mon Sep 17 00:00:00 2001 From: 0xboobface <0xboobface@gmail.com> Date: Thu, 6 Dec 2018 13:44:10 +0100 Subject: [PATCH] Don't log exception if interrupted, but not running anymore --- common/src/main/java/ctbrec/recorder/OnlineMonitor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/ctbrec/recorder/OnlineMonitor.java b/common/src/main/java/ctbrec/recorder/OnlineMonitor.java index 5bd96975..5ec98567 100644 --- a/common/src/main/java/ctbrec/recorder/OnlineMonitor.java +++ b/common/src/main/java/ctbrec/recorder/OnlineMonitor.java @@ -4,6 +4,7 @@ import static ctbrec.EventBusHolder.*; import static ctbrec.EventBusHolder.EVENT_TYPE.*; import static ctbrec.Model.STATUS.*; +import java.io.InterruptedIOException; import java.net.SocketTimeoutException; import java.time.Duration; import java.time.Instant; @@ -69,6 +70,10 @@ public class OnlineMonitor extends Thread { model.getName(), e.getResponseCode(), e.getResponseMessage()); } catch (SocketTimeoutException e) { LOG.error("Couldn't check if model {} is online. Request timed out", model.getName()); + } catch (InterruptedException | InterruptedIOException e) { + if(running) { + LOG.error("Couldn't check if model {} is online", model.getName(), e); + } } catch (Exception e) { LOG.error("Couldn't check if model {} is online", model.getName(), e); } @@ -107,7 +112,6 @@ public class OnlineMonitor extends Thread { evt.put(OLD, oldStatus); evt.put(MODEL, model); EventBusHolder.BUS.post(evt); - LOG.debug("Event fired {}", evt); } public void shutdown() {