Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

Commit

Permalink
export error
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvia Lei <[email protected]>
  • Loading branch information
Wwwsylvia committed Apr 25, 2023
1 parent 3a72828 commit 850c63b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"oras.land/oras-go/v2/registry/remote/auth"
)

// errClientTypeUnsupported is thrown by Login() when the registry's client type
// ErrClientTypeUnsupported is thrown by Login() when the registry's client type
// is not supported.
var errClientTypeUnsupported = errors.New("client type not supported")
var ErrClientTypeUnsupported = errors.New("client type not supported")

// Login provides the login functionality with the given credentials. The target
// registry's client should be nil or of type *auth.Client. Login uses
Expand All @@ -43,7 +43,7 @@ func Login(ctx context.Context, store Store, reg *remote.Registry, cred auth.Cre
} else if client, ok := reg.Client.(*auth.Client); ok {
authClient = *client
} else {
return errClientTypeUnsupported
return ErrClientTypeUnsupported
}
regClone.Client = &authClient
// update credentials with the client
Expand Down
2 changes: 1 addition & 1 deletion registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func TestLogin_unsupportedClient(t *testing.T) {
s := &testStore{}
cred := auth.EmptyCredential
err = Login(ctx, s, reg, cred)
if wantErr := errClientTypeUnsupported; !errors.Is(err, wantErr) {
if wantErr := ErrClientTypeUnsupported; !errors.Is(err, wantErr) {
t.Errorf("Login() error = %v, wantErr %v", err, wantErr)
}
}
Expand Down

0 comments on commit 850c63b

Please sign in to comment.