Improve error message for missing field to include field name and path#14
Merged
zhenthebuilder merged 1 commit intomainfrom Mar 3, 2026
Merged
Conversation
jackyzha0
approved these changes
Mar 3, 2026
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.
Why
When
get_fieldfails in the adder, the error message was a generic "Could not find field" with no indication of which field or path was being looked up. This makes debugging difficult.What changed
Changed
.context("Could not find field")to.with_context(|| ...)so the error message now includes the specific field name and path that couldn't be found. For example:Test plan
cargo checkpassesRevertibility
Safe to revert — no schema, data, or API changes.
Slack thread: https://slack.com/archives/D0AE3C12679/p1772573741283529
~ written by Zerg 👾