oxidecomputer / humility

Debugger for Hubris
Mozilla Public License 2.0
529 stars 51 forks source link

Improve NetCore's message when archive is missing. #445

Closed cbiffle closed 9 months ago

cbiffle commented 9 months ago

So @hawkw noticed this behavior:

$ cargo run -q -- --ip barf%eth0 probe
humility probe failed: invalid Zip archive: Invalid zip header

which confused us both. This is different from the normal "archive not provided" message, and probe itself doesn't require an archive at all!

It turns out to be a sequence of things:

So, by inserting an explicit check in NetCore instead of letting the zip crate fail, we get somewhat better feedback:

humility probe failed: archive is required for network use but was not provided
cbiffle commented 9 months ago

I feel like, at some point, the HubrisArchive type will want to be renamed (since it exists whether or not there's an archive), and .archive() will want to return Option since its contents can be missing. I haven't done that in this PR.