Skip to content

Commit

Permalink
Define our own ProvisionException
Browse files Browse the repository at this point in the history
to simplify dependency requirements for OSS.

#3897

PiperOrigin-RevId: 535265714
  • Loading branch information
cushon authored and Error Prone Team committed May 25, 2023
1 parent c27ceac commit 514d935
Showing 1 changed file with 11 additions and 1 deletion.
Expand Up @@ -24,7 +24,6 @@
import com.google.common.collect.MutableClassToInstanceMap;
import com.google.errorprone.ErrorProneFlags;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import com.google.inject.ProvisionException;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.List;
Expand All @@ -41,6 +40,17 @@
public final class ErrorProneInjector {
private final ClassToInstanceMap<Object> instances = MutableClassToInstanceMap.create();

/** Indicates that there was a runtime failure while providing an instance. */
public static final class ProvisionException extends RuntimeException {
public ProvisionException(String message) {
super(message);
}

public ProvisionException(String message, Throwable cause) {
super(message, cause);
}
}

public static ErrorProneInjector create() {
return new ErrorProneInjector();
}
Expand Down

0 comments on commit 514d935

Please sign in to comment.