bottlerocket-os / bottlerocket-os/bottlerocket-core-kit

[netdog] Improve error messaging in netdog when failing to match type of network device

Open
#419 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
34
Forks
77
Avg merge
2d 23h
Merged PRs (30d)
23

Description

There is a [known issue]( https://github.com/serde-rs/serde/issues/2157) in serde where matching enums obscures the errors when failing to match, making the user-facing errors opaque. Its [been around for a while](https://github.com/serde-rs/serde/issues/773) and folks have tried their [own ways](https://github.com/jonasbb/serde/tree/dev/serde#changes-compared-to-serde_derive) of solving this.

Since we have lots of exposure to this issue, we should figure out a way to expose the Deserialization failures to end users in a better way so they can debug why their `net.toml` isn't parsing into proper configuration. The primary goal is to provide the lower-level errors to the user so they can piece together why their config didn't result in proper configuration. Pulling this in will allow us to move all validation into Deserialize implementations and remove the Validate trait since our error messages won't be masked by the top-level enum deserialize.

Contributor guide

Open the contributing guide

Research direction

No specific files or tests are named. Start by locating netdog's configuration Deserialize and Validate implementations, then reproduce a malformed net.toml to inspect the current error. Done means exposing the lower-level deserialization failures clearly enough for users to diagnose configuration parsing, with Validate removal considered if the new errors support it.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.