Skip to content
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

[wicketd] replace snafu with thiserror #4950

Merged

Conversation

sunshowers
Copy link
Contributor

This is currently the only use of snafu in omicron (outside of transitive
deps), and I figure it is simple enough that we can replace it with thiserror,
reducing use of a direct dependency.

This was the first time I'd encountered snafu so I read a bit about it. As far
as I understand, the main benefit of snafu is that it pushes you heavily
towards an error-per-module pattern. However, thiserror does permit that
pattern as well, and in practice it is only a little more verbose than snafu to
do right (map_err vs context, though snafu introduces new types that
aren't in the source code like IoSnafu and ParseSnafu).

I'd love to get your take on it though @andrewjstone.

Created using spr 1.3.5
Copy link
Contributor

@andrewjstone andrewjstone left a comment

Choose a reason for hiding this comment

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

I forget exactly why I went down this road. I don't see any real benefit to snafu at this point. I agree it's better to keep things standardized with thiserror. Thanks for the fix!

@sunshowers sunshowers merged commit 5208d21 into main Feb 1, 2024
21 of 22 checks passed
@sunshowers sunshowers deleted the sunshowers/spr/wicketd-replace-snafu-with-thiserror branch February 1, 2024 17:35
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.

2 participants