Skip to content

Annotate YAML config errors with device, command, and line#289

Open
RiSKeD wants to merge 1 commit intomainfrom
feat/dut-yaml-unmarshal
Open

Annotate YAML config errors with device, command, and line#289
RiSKeD wants to merge 1 commit intomainfrom
feat/dut-yaml-unmarshal

Conversation

@RiSKeD
Copy link
Contributor

@RiSKeD RiSKeD commented Feb 27, 2026

Config parse errors previously gave no context about where in the file the problem occurred, e.g.:

parsing YAML failed: command must have at least one module

Add custom UnmarshalYAML to Devlist and Device that decode each entry individually and wrap errors with the device or command name. Update Command.UnmarshalYAML to include the YAML line number in its validation errors. Errors now read:

parsing YAML failed: device "hermes": command "power": yaml: line 14: ...

resolves #286

Copilot AI review requested due to automatic review settings February 27, 2026 14:59
@RiSKeD RiSKeD force-pushed the feat/dut-yaml-unmarshal branch from 5cd9f8e to 629e495 Compare February 27, 2026 15:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@AtomicFS
Copy link

AtomicFS commented Mar 3, 2026

This is way better! Thanks!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@RiSKeD
Copy link
Contributor Author

RiSKeD commented Mar 11, 2026

@jenstopp If you don't like the more complicated yaml parsing i would propose to just stick to printing out the line number which is a very small change.

@RiSKeD RiSKeD force-pushed the feat/dut-yaml-unmarshal branch 2 times, most recently from 0dacc67 to dc1ebe6 Compare March 11, 2026 07:55
@RiSKeD
Copy link
Contributor Author

RiSKeD commented Mar 11, 2026

I've reverted back to only outputting the line as the other way overcomplicated the yaml parsing.

Config parse errors previously gave no context about where in the file
the problem occurred, e.g.:

  parsing YAML failed: command must have at least one module

Update Command.UnmarshalYAML to include the YAML line number in its validation
errors. Errors now read:

  parsing YAML failed: line 14: ...

Signed-off-by: Fabian Wienand <fabian.wienand@9elements.com>
@jenstopp jenstopp force-pushed the feat/dut-yaml-unmarshal branch from dc1ebe6 to 53ae086 Compare March 16, 2026 14:29
@jenstopp jenstopp changed the title feat: annotate YAML config errors with device, command, and line Annotate YAML config errors with device, command, and line Mar 16, 2026
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.

YAML parsing error messages are useless

3 participants