From aaf2256635d65e08c2fc1963f17872a93c9f4ba2 Mon Sep 17 00:00:00 2001 From: GrĂ©goire DuchĂȘne Date: Sun, 20 Oct 2024 13:12:39 +0100 Subject: Join or wrap errors --- pkg/twilio/filter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg') 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) -- cgit v1.2.3-70-g09d2