Class ContextException

  • All Implemented Interfaces:
    Serializable

    public class ContextException
    extends Exception
    Used to pass a context to async exception handling for debugging purposes.
    See Also:
    Serialized Form
    • Constructor Detail

      • ContextException

        public ContextException()
    • Method Detail

      • herePrintingTrace

        @Nonnull
        public static Consumer<Throwable> herePrintingTrace()
        Creates a failure consumer that appends a context cause before printing the stack trace using Throwable.printStackTrace().
        Equivalent to here(Throwable::printStackTrace)
        Returns:
        Wrapping failure consumer around Throwable::printStackTrace
      • here

        @Nonnull
        public static Consumer<Throwable> here​(@Nonnull
                                               Consumer<? super Throwable> acceptor)
        Creates a wrapping Consumer for the provided target.
        Parameters:
        acceptor - The end-target for the throwable
        Returns:
        Wrapper of the provided consumer that will append a context with the current stack-trace