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

Remove error-chain and replace with handcrafted errors #107

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

faern
Copy link
Member

@faern faern commented Jul 12, 2024

This changes the API of the error a lot, and the returned error chain in many calls into this library.

This supersedes #88. I'm not saying we absolutely have to stay away from thiserror. But I had some questions about the details in that PR so I decided to try my own approach. And I like this approach. The error was easy to implement manually.

I have tried these changes out in our main app, and it does not create any trouble. We don't really match against the errors anywhere, so it just compiles with no changes. The error chain will print a bit differently if we run into an error, but hopefully the changes or not for the worse.


This change is Reviewable

@faern faern requested a review from hulthe July 12, 2024 12:35
@faern faern force-pushed the remove-error-chain branch from bf21ccc to c6a87e2 Compare July 17, 2024 06:52
@faern faern changed the title remove error-chain and replace with handcrafted errors Remove error-chain and replace with handcrafted errors Jul 17, 2024
@faern faern requested review from Serock3 and removed request for hulthe July 17, 2024 12:16
@faern faern marked this pull request as ready for review July 17, 2024 12:18
faern added 3 commits July 17, 2024 14:27
This changes the API of the error a lot, and the returned error chain in
many calls into this library
@faern faern force-pushed the remove-error-chain branch from c6a87e2 to 3cca651 Compare July 17, 2024 12:27
Copy link

@Serock3 Serock3 left a comment

Choose a reason for hiding this comment

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

Nice work! I like your implementation, although I probably would have preferred to use thiserror myself because of its simplicity, ubiquity and the fact that it would produce a very similar end product. Since you've already written it by hand I see no reason to change it, however :lgtm:

Reviewed 12 of 12 files at r1, 2 of 2 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@faern faern merged commit afa832e into main Jul 23, 2024
10 checks passed
@faern faern deleted the remove-error-chain branch July 23, 2024 08:38
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