Skip to content

Commit f566ad6

Browse files
loresusopoiana
authored andcommitted
chore: improve error messages in Login and ClientForRegistry
Signed-off-by: Lorenzo Susini <[email protected]>
1 parent 1a41d32 commit f566ad6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/registry/login/login.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (o *loginOptions) RunLogin(ctx context.Context, args []string) error {
9191

9292
if err := utils.CheckRegistryConnection(ctx, cred, registry, o.Printer); err != nil {
9393
o.Printer.Verbosef("%s", err.Error())
94-
return fmt.Errorf("unable to connect to registry %q", registry)
94+
return fmt.Errorf("unable to connect to registry %q: %w", registry, err)
9595
}
9696

9797
// Store validated credentials

internal/utils/registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func ClientForRegistry(ctx context.Context, registry string, printer *output.Pri
6161

6262
if err := CheckRegistryConnection(ctx, &cred, registry, printer); err != nil {
6363
printer.Verbosef("%s", err.Error())
64-
return nil, fmt.Errorf("unable to connect to registry %q", registry)
64+
return nil, fmt.Errorf("unable to connect to registry %q: %w", registry, err)
6565
}
6666

6767
return authn.NewClient(cred), err

0 commit comments

Comments
 (0)