Skip to content

Use anyhow for error handling #2783

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

Merged
merged 1 commit into from
Sep 19, 2020
Merged

Use anyhow for error handling #2783

merged 1 commit into from
Sep 19, 2020

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Sep 11, 2020

see https://github.com/dtolnay/anyhow

This seems easier than defining our own Error enum, and it allows us to easily add additional context to the errors when they bubble up the stack.

Since this is "application code" I assume that https://github.com/dtolnay/anyhow#comparison-to-thiserror applies and that anyhow is the better solution for us, compared to using something like thiserror.

r? @jtgeibel

/cc @dtolnay

Copy link
Member

@jtgeibel jtgeibel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me! When I split these errors out from AppError I hoped to eventually pick a good library for this. This seems like a fine solution.

I'm going to wait to merge until after the next deploy, because we already have a huge backlog pending.

@jtgeibel
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Sep 19, 2020

📌 Commit 52fdcc7 has been approved by jtgeibel

@bors
Copy link
Contributor

bors commented Sep 19, 2020

⌛ Testing commit 52fdcc7 with merge be1c127...

@bors
Copy link
Contributor

bors commented Sep 19, 2020

☀️ Test successful - checks-travis
Approved by: jtgeibel
Pushing be1c127 to master...

@bors bors merged commit be1c127 into rust-lang:master Sep 19, 2020
@Turbo87 Turbo87 deleted the anyhow branch September 24, 2020 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants