Package net.dv8tion.jda.api.exceptions
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ContextException()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Consumer<Throwable>here(Consumer<? super Throwable> acceptor)Creates a wrappingConsumerfor the provided target.static Consumer<Throwable>herePrintingTrace()Creates a failure consumer that appends a context cause before printing the stack trace usingThrowable.printStackTrace().-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Method Detail
-
herePrintingTrace
@Nonnull public static Consumer<Throwable> herePrintingTrace()
Creates a failure consumer that appends a context cause before printing the stack trace usingThrowable.printStackTrace().
Equivalent tohere(Throwable::printStackTrace)- Returns:
- Wrapping failure consumer around
Throwable::printStackTrace
-
here
@Nonnull public static Consumer<Throwable> here(@Nonnull Consumer<? super Throwable> acceptor)
Creates a wrappingConsumerfor 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
-
-