-
Notifications
You must be signed in to change notification settings - Fork 138
[WIP] Failure 0.2 #296
base: master
Are you sure you want to change the base?
[WIP] Failure 0.2 #296
Conversation
Brought up a point about the naming of |
This might be a bit radical but I believe we should name 🌏 I imagine a world where Rust has a primitive error type, named A thought .. why is there a name change being considered for Not saying I don't want a name change, just curious why it was added to the opening. |
I'll reproduce @yoshuawuyts' comment here:
I didn't think of that use-case, but you do raise a good point. I'd be happy to discuss these names, but initially, I am a fan of
I think you might be onto something there, but I'm in no way qualified to make that decision alone. How you would you feel about introducing
Failure's derive is exported as |
@davidbarsky yay, glad you found it helpful! By the way, I really like your idea of perhaps getting most of Failure's bits into stdlib. I think it'd be cool if every version of failure could move more into stdlib, until all we hit a ceiling. Coincidentally, have you considered writing about Failure's 0.2 design? Back in 2017 Boats wrote a post introducing failure. I think it'd be cool if there'd be something similar for the 0.2 changes; perhaps that could help people understand the changes in stdlib, and which role failure now plays ✨ |
I think that's a good idea! I tried to cover that via #287, but I think a blog post is a good idea. First things first, I'll need to create a blog. |
I see
I see The type itself can be completely opaque and just implement some important traits like In doing so you get the magical ability of being able to default I do plan to write up an RFC for this but am waiting for the 2019 roadmap and some 2018 stuff to shake out (e.g., await) so mind share is available. |
Naming: |
I think |
Hi! This PR introduces a few of the things I've talked about in #287, namely:
#[derive(Fail)]
to#[derive(Error)]
failure::Error
tofailure::DefaultError
Still needed:
AsFail for Fail
definition.Fail
toErrorExt
std::error::Error
, pending backtrace support instd
. This might need to wait until Failure 0.3, however—I haven't thought through the ramifications of that breaking change.Feedback, help and contributions are welcome!