-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emit error events rather than throwing #387
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible/worth it to have a simple test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the preference for dispatch error vs throw error? I feel like throw error gives more traceabability as to which call threw the error albeit certainly at the cost of needing to wrap functions that may error in a try catch. Dispatching makes the errors themselves a bit more of an implicit requirement to handle rather than more explicit or in your face. I think I prefer throwing errors, but I'm not totally against this
This was my issue with it -- especially when such functions are "non-obvious" that they may throw errors, like I could also see maybe some implementation that allows swapping between multiple atlas textures once we hit the size limit. Didn't feel like it was worth the complexity though. In practice it's very rare for labels to have so many unique characters and only happened in this case because a user was passing in corrupt string data. |
I guess as long as it's evident that an error is occurring in some way then it's fine. Another option to make it less implicit would be to require passing an |
Changelog
Added an
"error"
event to the LabelPool and FontManager.Docs
None
Description
Rather than throwing errors, emit them via an "error" event.
For FG-9839