-
Notifications
You must be signed in to change notification settings - Fork 416
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
Most fallible methods should return Result<T, failure::Error>
instead of Result<T, wasm_pack::error::Error>
#280
Comments
I'd be happy to take this one! |
@fitzgen wanted to check my understanding on this. The idea is I'll convert a fn like
What I'm not seeing -- and apologies if I'm overlooking something obvious -- is the best way to convert that Thanks! |
Correct.
All those should become
Thank you! |
Ah, gotcha. I think I'd misread your intent with leaf / non-leaf. Am I right in thinking that when you say "leaf" you mean something like a function that reads a config from disk? And a non-leaf fn is one that builds on top of it, e.g. initiating a build that depends on that config? |
Sorry about the inactivity -- life has crept up in a major way and I haven't had a chance to get to this yet. If anyone wants to take a stab at it, please do! |
I would like to give this a shot. I will try to start working on this soon and create a PR when I have. In the meantime if someone else would like to grab this, please do and let me know if that's the case. :) |
I ended up doing part of this work in #392 (3rd commit) if you want some examples of what needs to happen here. I only did enough to give better context to errors when running child processes, so there should be a bunch of places that are still not using |
Oh! And it might make sense to branch off of my PR to avoid a bunch of merge conflict ickiness -- sorry! |
@fitzgen: Thank you for the information, I will branch out from your PR. |
A
wasm_pack::error::Error
willInto
afailure::Error
so existing?
locations shouldn't need any changes.Basically, only "leaf" errors should be
wasm_pack::error::Error
and everything else should befailure::Error
.Then we should put
.context("..")
(or.with_context(|e| ...)
) onto all non-leaf?
sites, providing better error messages and cause-and-effect chains.The text was updated successfully, but these errors were encountered: