Skip to content

improve error message when invalid options given when pushing #1217

@qweeah

Description

@qweeah

If the provided reference is invalid

Current behavior and output:

$ oras push /oras --format json
Error: Head "https:///v2/oras/manifests/sha256:ffa50b27cd0096150c0338779c5090db41ba50d01179d851d68afa50b393c3a3": http: no Host in request URL

Suggested error message:

$ oras push /oras --format json
Error: "/oras" is an invalid reference
Usage: oras push [flags] <name>[:<tag>[,<tag>][...]] <file>[:<type>] [...]
Please specify a valid reference in the form of <registry>/<repo>[:tag|@digest]

If the to-be-pushed file doesn't exist

Current behavior and output:

$ oras push localhost:5000/oras:v1 hello.txt
Error: failed to stat /home/user/hello.txt: stat /home/user/hello.txt: no such file or directory

Suggested error message:

$ oras push localhost:5000/oras:v1 hello.txt
Error: /home/user/hello.txt: no such file or directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    uxUser experience related

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions