MCCoroutineExceptionEvent

class MCCoroutineExceptionEvent(plugin: <ERROR CLASS>, exception: Throwable)

A sponge event which is called when an exception is raised in one of the coroutines managed by MCCoroutine. Cancelling this exception causes the error to not get logged and offers to possibility for custom logging.

Constructors

MCCoroutineExceptionEvent
Link copied to clipboard
fun MCCoroutineExceptionEvent(plugin: <ERROR CLASS>, exception: Throwable)

Functions

getCause
Link copied to clipboard
open fun getCause(): <ERROR CLASS>

Gets the cause for the event. The Cause of the event is an object which implements the Iterable interface. So, when investigating the Cause of the event a common idiom is to use operations (functions) on the result of getCause as follows:

isCancelled
Link copied to clipboard
open fun isCancelled(): Boolean

Gets if this event is cancelled.

setCancelled
Link copied to clipboard
open fun setCancelled(flag: Boolean)

Sets the event as cancelled or not. If the event is cancelled the exception is seen as an uncaught exception. Do only cancel this event if you want to log the exceptions on your own.

Properties

exception
Link copied to clipboard
val exception: Throwable

The exception to be logged.

plugin
Link copied to clipboard
val plugin: <ERROR CLASS>

Plugin causing the exception.