Skip to content

Commit

Permalink
added additional description for token certificates an error #11
Browse files Browse the repository at this point in the history
  • Loading branch information
zebox committed Feb 4, 2023
1 parent c014070 commit c0bde7b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/registry/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ func NewRegistryToken(opts ...TokenOption) (*AccessToken, error) {
if err = rt.loadCerts(); err != nil {

// throw error when certs files exist but load is fail, otherwise tries to generate new certs
if !strings.HasPrefix(err.Error(), errPrefixCertsNotFound) {
return nil, err
if err != nil && !strings.HasPrefix(err.Error(), errPrefixCertsNotFound) {
return nil, fmt.Errorf("failed to load existed certificates for token: %v", err)
}

err = rt.createCerts()
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to create new certificats for token: %v", err)
}
}

Expand Down

0 comments on commit c0bde7b

Please sign in to comment.