Skip to content

made the Error type use thiserror #80

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kingananas20
Copy link

@kingananas20 kingananas20 commented Jun 5, 2025

I wanted to use this project but I found that the Error type is not exactly the best (in my opinion, mostly because the url in the NotFound struct wasn't public). So I converted it to use the thiserror crate. Yes there are some changes but I think it's better and cleaner now. I tried to keep the error messages the same but I think I discard 2 or 3. Please ask if you don't understand something.

/// Error returned by the crates.io API directly.
Api(crate::types::ApiErrors),
}

Copy link
Author

Choose a reason for hiding this comment

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

removed everything below because thiserror automatically implements them

@kingananas20 kingananas20 changed the title made the Error type better and cleaner by using the thiserror crate made the Error type use thiserror Jun 5, 2025
@kingananas20
Copy link
Author

kingananas20 commented Jun 7, 2025

@theduke this change is a breaking change but I could make it so that it's not a breaking change anymore if you want to (or just close this PR).

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.

1 participant