Skip to content

Commit

Permalink
feat: add custom JWK parse error type (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
nipsufn authored Oct 26, 2023
1 parent e6c61ed commit 771b19c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jwksx/fetcher_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"crypto/sha256"
"time"

"github.com/ory/herodot"

"github.com/hashicorp/go-retryablehttp"

"github.com/ory/x/fetcher"
Expand Down Expand Up @@ -156,7 +158,7 @@ func (f *FetcherNext) fetch(ctx context.Context, location string, opts *fetcherN

set, err := jwk.ParseReader(result)
if err != nil {
return nil, err
return nil, errors.WithStack(herodot.ErrBadRequest.WithReason("failed to parse JWK set").WithWrap(err))
}

if opts.useCache {
Expand Down

0 comments on commit 771b19c

Please sign in to comment.