-
Notifications
You must be signed in to change notification settings - Fork 115
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
Consider hiding Error
internals
#60
Comments
If you do this, it would make it harder to remember to Though if you're thinking of changing the error system, might I suggest the new failure crate? |
Do you have an example where this is useful? I've mostly returned elaborate error messages from within callbacks (ie. where the error actually happens), not after catching an error that happened elsewhere.
That's probably a good idea, but it does pull in an additional dependency. |
I'm not sure what type of changes your are thinking of making to the errors, but there are cases in Way Cooler where I explicitly match on Runtime or Type conversion errors in order to either swallow the error or perform a different action. Obviously this is still do-able with what you suggested, but if the error is opaque and changes when those errors happen it would make the error handling more difficult. For my 2 cents: if most of the error messages are either caught (e.g with an
AFAIK the plan is to eventually incorporate this into the STD. Most people (including me) are waiting for that to actually happen though, so if an additional dependency is too much then feel free to wait as well. |
The way I avoid this problem usually is to add another variant, |
Closing as this is out of date ( |
Currently, adding a variant to
Error
(or changing an existing one) is a breaking change. This happens pretty frequently during development. We could prevent that by makingError
a struct with a few helper methods to create a specific error, and make the internal enum private so it's not part of the API.This is probably not that important right now, but when rlua gets closer to a 1.0 release it could allow more freedom in expanding rlua's internals (better error messages, more distinguished error cases without a breaking change). I'm just opening this issue to get a bit of feedback.
The text was updated successfully, but these errors were encountered: