cloud icon indicating copy to clipboard operation
cloud copied to clipboard

[2.0.0] Suggestion to change default exception handling policy

Open A248 opened this issue 2 years ago • 1 comments

I don't know if this has been suggested before, but I thought I would mention it to bring it under consideration for 2.0.0, as it would require a behavioral change.

The current default behavior of platform implementations is to swallow and log exceptions. Sometimes System.err is used, sometimes a specific logging framework. Here's one example: https://github.com/Incendo/cloud/blob/8bdaeb1c8cbd318675a99bcc15eda3c70f51ff66/cloud-minecraft/cloud-bukkit/src/main/java/cloud/commandframework/bukkit/BukkitCommand.java#L156-L174

For Cloud 2.0.0, would it be possible to re-throw exceptions rather than swallow and log them by default?

Regardless of whether exception handlers can be configured for some of these exceptions, defaults matter.

A248 avatar Jul 14 '21 02:07 A248

Yup. That was poor planning on my part, but then we kind of got stuck with this. This is definitely something I want to improve for v2, as well as cleaning up exception usage internally in general.

Citymonstret avatar Jul 14 '21 08:07 Citymonstret