Throw instead of setting config if we get bad config
@@ -105,16 +105,11 @@ public class JRTConfigSubscription<T extends ConfigInstance> extends ConfigSubsc
}
protected void setNewConfig(JRTClientConfigRequest jrtReq) {
- Exception badConfigE = null;
- T configInstance = null;
try {
- configInstance = toConfigInstance(jrtReq);
- } catch (IllegalArgumentException e) {
- badConfigE = e;
- }
+ T configInstance = toConfigInstance(jrtReq);
setConfig(jrtReq.getNewGeneration(), jrtReq.responseIsApplyOnRestart(), configInstance, jrtReq.getNewChecksums());
- if (badConfigE != null) {
- throw new IllegalArgumentException("Bad config from jrt", badConfigE);
+ } catch (IllegalArgumentException e) {
+ throw new IllegalArgumentException("Bad config in response", e);
}
}
