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

fix: update error message for repo ls #1169

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

sajayantony
Copy link
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
Copy link

codecov-commenter commented Nov 3, 2023

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%) ⬇️

Copy link
Member

@TerryHowe TerryHowe left a comment

Choose a reason for hiding this comment

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

/lgtm

@sajayantony sajayantony merged commit dbf40e4 into oras-project:main Nov 6, 2023
6 checks passed
@sajayantony sajayantony deleted the errors-repo branch November 6, 2023 21:26
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.

None yet

4 participants