diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2024-10-20 13:12:39 +0100 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2024-10-20 13:12:39 +0100 |
| commit | aaf2256635d65e08c2fc1963f17872a93c9f4ba2 (patch) | |
| tree | 3cd7dd06c2832134f7904d4e6254b228c677e19a | |
| parent | 676b07a06ae92c4aec077493d825be90ff8cf1af (diff) | |
Join or wrap errors
| -rw-r--r-- | pkg/twilio/filter.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/twilio/filter.go b/pkg/twilio/filter.go index 4533f0c..1edd2aa 100644 --- a/pkg/twilio/filter.go +++ b/pkg/twilio/filter.go @@ -35,7 +35,7 @@ func (th *Filter) CheckRequestSignature(r *http.Request) error { } reqSig, err := base64.StdEncoding.DecodeString(hdr) if err != nil { - return ErrBase64 + return errors.Join(ErrBase64, err) } // See https://www.twilio.com/docs/usage/security#validating-requests @@ -57,7 +57,7 @@ func (th *Filter) CheckRequestSignature(r *http.Request) error { s := r.URL.String() + strings.Join(parts, "") h := hmac.New(sha1.New, th.AuthToken) if _, err := h.Write([]byte(s)); err != nil { - return fmt.Errorf("failed to write bytes to calculate signature: %s", err) + return fmt.Errorf("failed to write bytes to calculate signature: %w", err) } ourSig := h.Sum(nil) |
