Class InternalProvisionException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.google.inject.internal.InternalProvisionException
-
- All Implemented Interfaces:
Serializable
public final class InternalProvisionException extends Exception
A checked exception for provisioning errors.This is the internal dual of
ProvisionException
, similar to the relationship betweenConfigurationException
andErrorsException
. This is useful for several reasons:- Since it is a checked exception, we get some assistance from the java compiler in ensuring that we correctly handle it everywhere. ProvisionException is unchecked.
- Since this is an internal package, we can add useful construction and mutation APIs that would be undesirable in a public supported API.
This exception will be thrown when errors are encountered during provisioning, ErrorsException will continue to be used for errors that are encountered during provisioning and both make use of the
Message
as the core model.NOTE: this object stores a list of messages but in the most common case the cardinality will be 1. The only time that multiple errors might be reported via this mechanism is when
errorInUserCode(com.google.inject.internal.ErrorId, java.lang.Throwable, java.lang.String, java.lang.Object...)
is called with an exception that holds multiple errors (like ProvisionException).- See Also:
- Serialized Form
-
-
Method Summary
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Method Detail
-
circularDependenciesDisabled
public static InternalProvisionException circularDependenciesDisabled(Class<?> expectedType)
-
cannotProxyClass
public static InternalProvisionException cannotProxyClass(Class<?> expectedType)
-
create
public static InternalProvisionException create(ErrorId errorId, String format, Object... arguments)
-
errorInUserCode
public static InternalProvisionException errorInUserCode(ErrorId errorId, Throwable cause, String messageFormat, Object... arguments)
-
subtypeNotProvided
public static InternalProvisionException subtypeNotProvided(Class<? extends javax.inject.Provider<?>> providerType, Class<?> type)
-
errorInProvider
public static InternalProvisionException errorInProvider(Throwable cause)
-
errorInjectingMethod
public static InternalProvisionException errorInjectingMethod(Throwable cause)
-
errorInjectingConstructor
public static InternalProvisionException errorInjectingConstructor(Throwable cause)
-
errorInUserInjector
public static InternalProvisionException errorInUserInjector(MembersInjector<?> listener, TypeLiteral<?> type, RuntimeException cause)
-
jitDisabled
public static InternalProvisionException jitDisabled(Key<?> key)
-
errorNotifyingInjectionListener
public static InternalProvisionException errorNotifyingInjectionListener(InjectionListener<?> listener, TypeLiteral<?> type, RuntimeException cause)
-
toProvisionException
public ProvisionException toProvisionException()
Returns this exception convered to a ProvisionException.
-
-