wash icon indicating copy to clipboard operation
wash copied to clipboard

[BUG] `wash claims inspect` reports incorrect error message for missing file

Open brooksmtownsend opened this issue 2 years ago • 0 comments

Describe the bug I was attempting to inspect an actor file when I had the incorrect filename, and I got the following error:

wash claims inspect build/echotg_s.wasm

Pulling artifacts with tag 'latest' is prohibited. This can be overriden with a flag

Or with JSON output:

wash claims inspect build/echotg_s.wasm -o json

{
  "success": false,
  "error": "Pulling artifacts with tag 'latest' is prohibited. This can be overriden with a flag"
}

This is because the original failure to find a file results in a fallback to pull an OCI artifact. We should be able to parse the argument for claims inspect and par inspect to determine if it's truly a path or a URL and report errors accordingly.

To Reproduce Steps to reproduce the behavior:

  1. Install wash
  2. Run wash claims inspect hooha/notareal/path.wasm
  3. View error

Expected behavior In this case where I had the filename wrong, I should get an error stating that no file was found. We can still default to trying to pull an OCI artifact just in case there's some edge case with a URL that looks like a filepath (e.g. build.com/myartifact/wasm is both a valid URL and path) but we should at least have an indication that wash couldn't find a file.

brooksmtownsend avatar May 24 '22 13:05 brooksmtownsend