haxetink / tink_core

Core utilities
https://haxetink.github.io/tink_core
MIT License
117 stars 33 forks source link

Add exception handling to `CallbackList.invoke` #175

Open gene-pavlovsky opened 9 months ago

gene-pavlovsky commented 9 months ago

to prevent this kind of shit: https://try.haxe.org/#50b2a5Ce

The main idea behind this PR:

Any other similar places that could benefit from such error-proofing?

P.S. I now remember suggesting this: https://github.com/haxetink/tink_core/issues/165 Having been bitten by this problem again (when a signal handler throws), I couldn't wait any longer and came up with this limited solution. I don't see any reason not to do this by default, because I think this fixes an actual library bug, but since it can be kind of a breaking change, maybe it should be on an opt-in basis (conditional compilation flag).