refactor!: replace anyhow with thiserror#4925
Merged
clason merged 5 commits intotree-sitter:masterfrom Nov 14, 2025
Merged
Conversation
74af8e2 to
8a820be
Compare
Contributor
|
needs (another) local |
9 tasks
Member
Author
Oops, messed up the rebase. Thanks for the fixup! |
d524ab0 to
a37ee05
Compare
Member
Author
|
It's been long enough, I think as long as we can give this PR its due diligence this should be fine to include in 0.26.1. |
clason
approved these changes
Nov 14, 2025
a37ee05 to
b0c7c78
Compare
Contributor
|
Let's give this a whirl then! |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This removes all usage of the anyhow crate from the project outside of the cli and xtask crates. In particular, the loader and config crates now return errors in the form of structured data via thiserror.
I'm opening this as a draft for now, as this shouldn't block the 0.26.1 release. This has a large set of user-facing changes (error messages are important!), so regardless of the release this shouldn't be rushed in without a thorough check over.
I also slightly reworked the usage of thiserror in the generate crate to include the relevant path (if available) when an IO error occurs. This is more verbose at call sites, but should be very helpful in both debugging and giving more context to end users.