Skip to content

fix: update error message for repo ls#1169

Merged
sajayantony merged 2 commits into
oras-project:mainfrom
sajayantony:errors-repo
Nov 6, 2023
Merged

fix: update error message for repo ls#1169
sajayantony merged 2 commits into
oras-project:mainfrom
sajayantony:errors-repo

Conversation

@sajayantony

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
Improves the error message to show the registry and namespace when catalog listing fails.

$ oras repo ls docker.io
Error: could not list repositories for "registry-1.docker.io"
GET "https://registry-1.docker.io/v2/_catalog": GET "https://auth.docker.io/token?scope=registry%3Acatalog%3A%2A&service=registry.docker.io": response status code 400: Bad Request
$ oras repo ls docker.io/python
Error: could not list repositories for "registry-1.docker.io" with prefix "python/"
GET "https://registry-1.docker.io/v2/_catalog": GET "https://auth.docker.io/token?scope=registry%3Acatalog%3A%2A&service=registry.docker.io": response status code 400: Bad Request

Signed-off-by: Sajay Antony <sajaya@microsoft.com>
@codecov-commenter

codecov-commenter commented Nov 3, 2023

Copy link
Copy Markdown

Codecov Report

Merging #1169 (48ce099) into main (94e32e8) will decrease coverage by 0.04%.
The diff coverage is 70.00%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff             @@
##             main    #1169      +/-   ##
==========================================
- Coverage   80.03%   80.00%   -0.04%     
==========================================
  Files          65       65              
  Lines        3551     3560       +9     
==========================================
+ Hits         2842     2848       +6     
- Misses        494      495       +1     
- Partials      215      217       +2     
Files Coverage Δ
cmd/oras/root/repo/ls.go 88.23% <70.00%> (-4.63%) ⬇️

Comment thread cmd/oras/root/repo/ls.go

@TerryHowe TerryHowe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants