Skip to content

Commit 9efd567

Browse files
authored
FFM-11867 Cleanup error logs (#355)
**What** - Don't log an error if an SDK key doesn't exist **Why** - This is a user error and not a Proxy error
1 parent ac41a0a commit 9efd567

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

token/token_source.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package token
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"time"
78

@@ -41,7 +42,9 @@ func (a Source) GenerateToken(key string) (domain.Token, error) {
4142

4243
env, ok, err := a.repo.Get(context.Background(), k)
4344
if err != nil {
44-
a.log.Error("failed to get auth key from cache to generate token", "err", err)
45+
if !errors.Is(err, domain.ErrCacheNotFound) {
46+
a.log.Error("failed to get auth key from cache to generate token", "err", err)
47+
}
4548
}
4649
if !ok {
4750
return domain.Token{}, fmt.Errorf("%w: key not found", err)

0 commit comments

Comments
 (0)