Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve error message when invalid options given when pushing #1217

Closed
Tracked by #1218
qweeah opened this issue Dec 26, 2023 · 0 comments · Fixed by #1221 or #1258
Closed
Tracked by #1218

improve error message when invalid options given when pushing #1217

qweeah opened this issue Dec 26, 2023 · 0 comments · Fixed by #1221 or #1258
Labels
ux User experience related
Milestone

Comments

@qweeah
Copy link
Contributor

qweeah commented Dec 26, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ux User experience related
Projects
None yet
1 participant