Class ContextException

java.lang.Object
java.lang.Throwable
java.lang.Exception
net.dv8tion.jda.api.exceptions.ContextException
All Implemented Interfaces:
Serializable

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

    • ContextException

      public ContextException()
  • Method Details

    • 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