@Override
 public void onFailure(String source, Exception e) {
   try {
     listener.onFailure(source, e);
   } catch (Exception inner) {
     inner.addSuppressed(e);
     logger.error(
         (Supplier<?>)
             () ->
                 new ParameterizedMessage(
                     "exception thrown by listener notifying of failure from [{}]", source),
         inner);
   }
 }
 @Override
 public void onNoLongerMaster(String source) {
   try {
     listener.onNoLongerMaster(source);
   } catch (Exception e) {
     logger.error(
         (Supplier<?>)
             () ->
                 new ParameterizedMessage(
                     "exception thrown by listener while notifying no longer master from [{}]",
                     source),
         e);
   }
 }
 @Override
 public void clusterStateProcessed(String source, ClusterState oldState, ClusterState newState) {
   try {
     listener.clusterStateProcessed(source, oldState, newState);
   } catch (Exception e) {
     logger.error(
         (Supplier<?>)
             () ->
                 new ParameterizedMessage(
                     "exception thrown by listener while notifying of cluster state processed from [{}], old cluster state:\n"
                         + "{}\nnew cluster state:\n{}",
                     source,
                     oldState.prettyPrint(),
                     newState.prettyPrint()),
         e);
   }
 }