Class ConstructorAdviceException
- All Implemented Interfaces:
Serializable
An exception thrown by advice is the user's exception: when advice around a method throws, the
caller sees it as it was thrown. Advice around a constructor runs while the container is creating
the bean, where any throwable is otherwise wrapped in a BeanInstantiationException. This carrier
lets the container tell the two apart, so that an exception thrown by construction advice is rethrown
unchanged while an exception thrown by the constructor body keeps being wrapped.
Used for flow control only: it is thrown and caught between
ConstructorInterceptorChain#instantiate and the bean creation boundary in
DefaultBeanContext, and never reaches user code. It carries no stack trace of its own — the
exception the advice threw keeps its own, and it is that one the caller sees.
- Since:
- 5.2.0
- Author:
- Denis Stepanov
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Throwable
addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ConstructorAdviceException
- Parameters:
cause- The exception the advice threw
-
-
Method Details
-
getAdviceCause
- Returns:
- The exception the advice threw, to be rethrown in place of this carrier
-
fillInStackTrace
- Overrides:
fillInStackTracein classThrowable
-