public static void checkSuccess ( Future < ? > future , String errorMessage ) { requireNonNull ( future , "future is null" ) ; requireNonNull ( errorMessage , "errorMessage is null" ) ; checkArgument ( future . isDone ( ) , "future not done yet" ) ; try { getFutureValue ( future ) ; } catch ( RuntimeException e ) { throw new IllegalArgumentException ( errorMessage , e ) ; } }
Checks that the completed future completed successfully .