Skip to content

Improve error message for missing field to include field name and path#14

Merged
zhenthebuilder merged 1 commit intomainfrom
zhen/improve-field-not-found-error-message
Mar 3, 2026
Merged

Improve error message for missing field to include field name and path#14
zhenthebuilder merged 1 commit intomainfrom
zhen/improve-field-not-found-error-message

Conversation

@zhenthebuilder
Copy link
Contributor

Why

When get_field fails 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:

Could not find field 'myField' at path 'section/subsection'

Test plan

  • cargo check passes
  • Error paths will now produce more descriptive messages

Revertibility

Safe to revert — no schema, data, or API changes.


Slack thread: https://slack.com/archives/D0AE3C12679/p1772573741283529

~ written by Zerg 👾

@zhenthebuilder zhenthebuilder marked this pull request as ready for review March 3, 2026 21:41
@zhenthebuilder zhenthebuilder merged commit e8c04b4 into main Mar 3, 2026
2 checks passed
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