Skip to content

Commit

Permalink
prevent to return error when the apiclient user attempts to create an…
Browse files Browse the repository at this point in the history
… already registered token
  • Loading branch information
lucasmenendez committed Aug 21, 2024
1 parent ed27299 commit 47cab1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apiclient/tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (c *HTTPclient) CreateToken(token *api.Token) error {
log.Errorf("error closing response body: %v", err)
}
}()
if res.StatusCode != http.StatusCreated && res.StatusCode != http.StatusOK {
if res.StatusCode != http.StatusCreated && res.StatusCode != http.StatusOK && res.StatusCode == http.StatusConflict {
return fmt.Errorf("%w: %w", ErrNoStatusOk, fmt.Errorf("%d %s", res.StatusCode, http.StatusText(res.StatusCode)))
}
return nil
Expand Down

0 comments on commit 47cab1e

Please sign in to comment.