Skip to content

improve error message when invalid options given when pushing #1217

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

Activity

  1. added
    ux
    on Dec 26, 2023
  2. added this to the v1.2.0 milestone on Dec 26, 2023
  3. reopened this on Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ux

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions