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

Use thiserror throughout testnet/stacks-node #5413

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

jferrant
Copy link
Collaborator

Made thiserror a workspace lib. I also checked and made sure no unsafe throughout even in the updated version.
Updated the custom fmt::Display implementations throughout testnet/stacks-node to use thiserror cause I love red <3

Signed-off-by: Jacinta Ferrant <jacinta@trustmachines.co>
@jferrant jferrant requested review from a team as code owners October 31, 2024 22:56
Copy link
Contributor

@hstove hstove left a comment

Choose a reason for hiding this comment

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

LGTM!

Question generally - I get that this is very useful for errors, but is there anything about thiserror that is only relevant for errors? To me, this seems to just be a handy mechanism for implementing Display on anything.

Is it mainly that the library also provides optional macros for source, from, etc?

@jferrant
Copy link
Collaborator Author

jferrant commented Nov 1, 2024

LGTM!

Question generally - I get that this is very useful for errors, but is there anything about thiserror that is only relevant for errors? To me, this seems to just be a handy mechanism for implementing Display on anything.

Is it mainly that the library also provides optional macros for source, from, etc?

Yes it implements source, from, display, etc very easily. It just cleans up the code a little bit and makes it easier to add error codes :) It isn't as noticeable in stacks-node vs the stackslib code, but starting small to make it easier to review and to get buy-in before I commit to changing it everywhere

@jcnelson
Copy link
Member

jcnelson commented Nov 1, 2024

I also checked and made sure no unsafe throughout even in the updated version.

Thanks for doing the due diligence on this!

@jcnelson jcnelson added this pull request to the merge queue Nov 1, 2024
Merged via the queue into develop with commit 7e29f76 Nov 1, 2024
1 check passed
@blockstack-devops
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Nov 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants