Class ContextException

  • All Implemented Interfaces:
    java.io.Serializable

    public class ContextException
    extends java.lang.Exception
    Used to pass a context to async exception handling for debugging purposes.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.function.Consumer<java.lang.Throwable> here​(java.util.function.Consumer<? super java.lang.Throwable> acceptor)
      Creates a wrapping Consumer for the provided target.
      static java.util.function.Consumer<java.lang.Throwable> herePrintingTrace()
      Creates a failure consumer that appends a context cause before printing the stack trace using Throwable.printStackTrace().
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ContextException

        public ContextException()
    • Method Detail

      • herePrintingTrace

        @Nonnull
        public static java.util.function.Consumer<java.lang.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 java.util.function.Consumer<java.lang.Throwable> here​(@Nonnull
                                                                            java.util.function.Consumer<? super java.lang.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