2021-02-09 09:52:26 +01:00
|
|
|
package dev.kske.eventbus.core;
|
2020-09-02 16:15:31 +02:00
|
|
|
|
|
|
|
/**
|
2021-11-01 09:42:12 +01:00
|
|
|
* This unchecked exception is specific to the event bus and can be thrown under the following
|
|
|
|
* circumstances:
|
|
|
|
* <ul>
|
2021-11-01 20:52:14 +01:00
|
|
|
* <li>An event handler throws an exception (which is stored as the cause)</li>
|
2021-11-01 09:42:12 +01:00
|
|
|
* <li>An event listener with an invalid event handler is registered</li>
|
|
|
|
* <li>{@link EventBus#cancel()} is invoked from outside an active dispatch thread</li>
|
|
|
|
* </ul>
|
2020-09-02 16:15:31 +02:00
|
|
|
*
|
|
|
|
* @author Kai S. K. Engelbart
|
|
|
|
* @since 0.0.1
|
|
|
|
*/
|
2021-11-01 09:42:12 +01:00
|
|
|
public final class EventBusException extends RuntimeException {
|
2020-09-02 16:15:31 +02:00
|
|
|
|
2022-01-08 14:32:24 +01:00
|
|
|
private static final long serialVersionUID = 7254445250300604449L;
|
2020-09-02 16:15:31 +02:00
|
|
|
|
2020-09-23 20:55:16 +02:00
|
|
|
/**
|
|
|
|
* Creates a new event bus exception.
|
|
|
|
*
|
|
|
|
* @param message the message to display
|
|
|
|
* @param cause the cause of this exception
|
2022-01-08 14:32:24 +01:00
|
|
|
* @since 0.0.1
|
2020-09-23 20:55:16 +02:00
|
|
|
*/
|
2020-09-02 16:15:31 +02:00
|
|
|
public EventBusException(String message, Throwable cause) {
|
|
|
|
super(message, cause);
|
|
|
|
}
|
|
|
|
|
2020-09-23 20:55:16 +02:00
|
|
|
/**
|
|
|
|
* Creates a new event bus exception.
|
|
|
|
*
|
|
|
|
* @param message the message to display
|
2022-01-08 14:32:24 +01:00
|
|
|
* @since 0.0.1
|
2020-09-23 20:55:16 +02:00
|
|
|
*/
|
2020-09-02 16:15:31 +02:00
|
|
|
public EventBusException(String message) {
|
|
|
|
super(message);
|
|
|
|
}
|
|
|
|
}
|