aboutsummaryrefslogtreecommitdiffstats
path: root/config-proxy
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2021-10-01 11:39:55 +0200
committerHarald Musum <musum@yahooinc.com>2021-10-01 11:39:55 +0200
commited1aab3cacc7fb7b4c2959711f4e1cd591422da4 (patch)
tree3037448785ba5909e04a2bf7bfcb92a9dd2cd214 /config-proxy
parentbc59af0450d0e99860c61371ad942e3b50e8778f (diff)
Catch exception
Diffstat (limited to 'config-proxy')
-rw-r--r--config-proxy/src/main/java/com/yahoo/vespa/config/proxy/Subscriber.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/Subscriber.java b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/Subscriber.java
index e79497e0dd3..f7e295c48bd 100644
--- a/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/Subscriber.java
+++ b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/Subscriber.java
@@ -5,15 +5,14 @@ import com.yahoo.config.subscription.ConfigSourceSet;
import com.yahoo.config.subscription.impl.GenericConfigHandle;
import com.yahoo.config.subscription.impl.GenericConfigSubscriber;
import com.yahoo.config.subscription.impl.JRTConfigRequester;
-
-import java.util.Optional;
-import java.util.logging.Level;
import com.yahoo.vespa.config.ConfigKey;
import com.yahoo.vespa.config.RawConfig;
import com.yahoo.vespa.config.TimingValues;
import com.yahoo.yolean.Exceptions;
import java.util.Map;
+import java.util.Optional;
+import java.util.logging.Level;
import java.util.logging.Logger;
/**
@@ -43,14 +42,13 @@ public class Subscriber {
}
public Optional<RawConfig> nextGeneration() {
- if (subscriber.nextGeneration(0, true)) { // Proxy should never skip config due to not initializing
- try {
+ try {
+ if (subscriber.nextGeneration(0, true))// Proxy should never skip config due to not initializing
return Optional.of(handle.getRawConfig());
- } catch (Exception e) { // To avoid thread throwing exception and loop never running this again
- log.log(Level.WARNING, "Got exception: " + Exceptions.toMessageString(e));
- } catch (Throwable e) {
- com.yahoo.protect.Process.logAndDie("Got error, exiting: " + Exceptions.toMessageString(e));
- }
+ } catch (Exception e) { // To avoid thread throwing exception and loop never running this again
+ log.log(Level.WARNING, "Got exception: " + Exceptions.toMessageString(e));
+ } catch (Throwable e) {
+ com.yahoo.protect.Process.logAndDie("Got error, exiting: " + Exceptions.toMessageString(e));
}
return Optional.empty();
}