Skip to content

improve error message when registry credential config is not valid #1236

@qweeah

Description

@qweeah

E.g. pulling an artifact and the target credential cannot be found in the config, current output will be like:

$ oras pull localhost:7000/repo:tag --registry-config auth.config
Error: failed to resolve tag: GET "http://localhost:7000/v2/repo/manifests/tag": credential required for basic auth

The error message is not helpful since

  1. It's purely a local error but contains details like HTTP method and URI
  2. Doesn't mention how to fix the issue

Suggest to change the error to sth like:

$ oras pull localhost:7000/repo:tag --registry-config auth.config
Error: failed to authenticate when attempting to pull: no valid credential found in auth.config
Please check whether the registry credential stored in the authentication file is correct

Metadata

Metadata

Assignees

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