jakobkmar / KSpigot

Extended Spigot and Bukkit API for Kotlin
https://jakobkmar.github.io/KSpigot
GNU General Public License v3.0
138 stars 33 forks source link

Allow catching of exceptions in chained runnables #2

Closed F0Xde closed 4 years ago

F0Xde commented 4 years ago

The user can handle exceptions of a specified type occurring in a chained runnable by calling executeCatching and optionally passing a handler function.

This is needed needed in order to gracefully stop the execution of a runnable chain without the exception being caught by Bukkit and resulting in it being logged as uncaught, while also allowing further handling of the exception.