Skip to content

Commit

Permalink
Migrate from soon-to-be-deprecated propagateIfPossible to equivalen…
Browse files Browse the repository at this point in the history
…t `throwIfInstanceOf` and `throwIfUnchecked` calls.

PiperOrigin-RevId: 613760381
  • Loading branch information
cpovirk authored and Caliper Team committed Mar 8, 2024
1 parent 151a691 commit 122c02d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
package com.google.caliper.runner.options;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Throwables.throwIfInstanceOf;
import static com.google.common.base.Throwables.throwIfUnchecked;

import com.google.caliper.util.DisplayUsageException;
import com.google.caliper.util.InvalidCommandException;
import com.google.caliper.util.Parser;
import com.google.caliper.util.Parsers;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterators;
Expand Down Expand Up @@ -445,7 +446,8 @@ private static void invokeMethod(Object injectee, Method method, Object value)
throw new AssertionError(impossible);
} catch (InvocationTargetException e) {
Throwable cause = e.getCause();
Throwables.propagateIfPossible(cause, InvalidCommandException.class);
throwIfInstanceOf(cause, InvalidCommandException.class);
throwIfUnchecked(cause);
throw new RuntimeException(e);
}
}
Expand Down

0 comments on commit 122c02d

Please sign in to comment.