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:
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ContextException.ContextConsumer
-
Constructor Summary
Constructors Constructor Description ContextException()
-
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 wrappingConsumer
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 usingThrowable.printStackTrace()
.
-
-
-
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 usingThrowable.printStackTrace()
.
Equivalent tohere(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 wrappingConsumer
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
-
-