Check against exception cause instead
@@ -246,14 +246,16 @@ public class ConfigServerBootstrap extends AbstractComponent implements Runnable
ApplicationId app = f.getKey();
try {
f.getValue().get();
- } catch (TransientException e) {
+ } catch (ExecutionException e) {
+ if (e.getCause() instanceof TransientException) {
log.log(LogLevel.INFO, "Redeploying " + app +
" failed with transient error, will retry after bootstrap: " + Exceptions.toMessageString(e));
- } catch (ExecutionException e) {
+ } else {
log.log(LogLevel.WARNING, "Redeploying " + app + " failed, will retry", e);
failedDeployments.add(app);
}
}
+ }
executor.shutdown();
executor.awaitTermination(365, TimeUnit.DAYS); // Timeout should never happen
return failedDeployments;
