Skip to content

Commit

Permalink
fix: surface fetch challenge cache get error (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
m16w committed Feb 6, 2024
1 parent a47bce0 commit 44ad3eb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/challenge/challenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ func FetchChallenge(ctx context.Context, c cache.Cache, walletAddress string) (s
cacheKey := fmt.Sprintf("%s:%s", cacheKeyPrefix, walletAddress)

res, err := c.Get(ctx, cacheKey)
if err != nil {
return "", fmt.Errorf("could not fetch challenge from cache: %w", err)
}
if res == nil {
return "", fmt.Errorf("challenge not present in cache")
}
if err != nil {
return "", fmt.Errorf("could not fetch challenge from cache: %s", res)
}

cachedChallenge, ok := res.(string)
if !ok {
Expand Down

0 comments on commit 44ad3eb

Please sign in to comment.