Skip to content

fix(gnd): surface anyhow error chains in error output#6622

Open
mvanhorn wants to merge 1 commit into
graphprotocol:masterfrom
mvanhorn:fix/6360-gnd-error-chain-display
Open

fix(gnd): surface anyhow error chains in error output#6622
mvanhorn wants to merge 1 commit into
graphprotocol:masterfrom
mvanhorn:fix/6360-gnd-error-chain-display

Conversation

@mvanhorn

Copy link
Copy Markdown

Summary

gnd error output now surfaces the full anyhow error chain instead of only the top-level message. The bare {} Display formattings in main.rs and watch.rs printed just the outermost context (for example failed to load manifest), hiding the underlying cause a developer needs to act on; they now use the alternate {:#} chain rendering. The two bare serde_yaml::from_str()? sites in commands/build.rs and manifest.rs gain context so YAML parse failures name the file being parsed.

Why this matters

Issue #6360 reports that gnd swallows error causes, leaving developers with messages like Error: failed to start watch mode and no underlying reason. The silenced chains were verified at main.rs:266 and watch.rs:49/104 before the change. This covers the error-display half of the issue; the issue also discusses restructuring some error sites to attach more context at creation time, which is a larger refactor left for a follow-up.

Testing

A new unit test asserts a manifest parse failure renders with its cause chain (file name + YAML error) rather than the bare context string. cargo fmt --check and cargo check -p gnd pass; the new manifest error-chain test passes.

Refs #6360

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