Class WrappedThrowableException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
dev.dbos.transact.spring.WrappedThrowableException
All Implemented Interfaces:
Serializable

public class WrappedThrowableException extends RuntimeException
A RuntimeException wrapper used to pass non-Exception Throwables (typically Errors) through ThrowingSupplier interfaces that are constrained to Exception types.

This is an internal implementation detail used by DBOSAspect to handle the mismatch between AspectJ's ProceedingJoinPoint.proceed() which can throw any Throwable, and DBOS's ThrowingSupplier which only accepts Exception types.

The wrapped Throwable should be extracted and rethrown to preserve original error semantics.

See Also:
  • Constructor Details

    • WrappedThrowableException

      public WrappedThrowableException(Throwable wrappedThrowable)
      Wraps a non-Exception Throwable (typically an Error) so it can be passed through Exception-constrained interfaces.
      Parameters:
      wrappedThrowable - the original Throwable to wrap, must not be an Exception
  • Method Details

    • getWrappedThrowable

      public Throwable getWrappedThrowable()
      Gets the original wrapped Throwable.
      Returns:
      the original Throwable that was wrapped