Open jpmcb opened 2 years ago
I was looking into this, but the only error message that can really "bubble up" is this: data did not match any variant of untagged enum Crd
There seems to be an open PR for the serde repo (https://github.com/serde-rs/serde/pull/1544) that has not been merged yet, but it would solve this issue as well. The only other solution that I can think of for the moment is to manually parse the YAML file.
The only other solution that I can think of for the moment is to manually parse the YAML file.
Nice find! This seems like something the upstream de-serializing library should report errors back on and not something we'd want to do extra work by do an additional yaml parsing. Can keep an eye on that PR!
It might be necessary to print anyhow::Error with debug {:?}
to see the underlying error "pseudo stack trace"
Given a test yaml that looks like:
and attempting to run it:
_Note that the
keep_running
key should bekeepRunning
_. The CRD key error isn't bubbled up from the underlyingread_manifest
https://github.com/bottlerocket-os/bottlerocket-test-system/blob/e4c6d22e76cacde344ef0765ed5630edf15ea58e/cli/src/run_file.rs#L17
Still new to rust, but it would be great if a more descriptive error was returned.