Replies: 2 comments 1 reply
-
In short, I think yes. It seems unlikely that we'd be removing variants very often post 1.0. We may slightly change the meaning of variants, but if we actually remove them that seems like we've changed conceptually what a function is doing, which seems like a situation where we'd want to create a new function anyway. I'm not saying it won't happen, just that it'll be rare and I think it's ok if it results in our error variants being somewhat crufty. |
Beta Was this translation helpful? Give feedback.
-
We simply must be confident that we will always return each variant. E.g. it's inconceivable that hex parsing will ever not return This also makes me question if having a length limit on If we can't promise that, our only option is to return Note that there's also an argument that we could stabilize sooner if we completely hide each error type and unhide them later. (Unhiding is strictly breaking but for such silly reason that I'd make an exception there.) Though it's not a silver bullet and I am confident about some error types. |
Beta Was this translation helpful? Give feedback.
-
This is non-urgent musing about how our current error code will work post 1.0
We are making an effort to make it possible to update error types in a non-API breaking way. Are we painting ourselves into a place where to maintain the "correctness" of our error code we can no longer update functions.
Consider this code
Now consider post 1.0 something changes in the foo type that means the pubic
foo_checker
now has different function exits, including a new error variant and removal of an old error variant.The change is not API breaking so we have been successful in that regard, however the function now returns an error with unused variants. How do we handle that, accumulate all such changes until the next major release?
Beta Was this translation helpful? Give feedback.
All reactions