From 5f953e08692bd59f28c2e2ed41cbee95bb7e247a Mon Sep 17 00:00:00 2001 From: Denys Smirnov Date: Mon, 9 Dec 2024 02:34:36 +0200 Subject: [PATCH] Print auth challenge when parsing fails. (#239) --- pkg/sip/outbound.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/sip/outbound.go b/pkg/sip/outbound.go index 9127f8d..8180a3f 100644 --- a/pkg/sip/outbound.go +++ b/pkg/sip/outbound.go @@ -656,9 +656,10 @@ authLoop: if headerVal == nil { return nil, errors.New("no auth header in response") } - challenge, err := digest.ParseChallenge(headerVal.Value()) + challengeStr := headerVal.Value() + challenge, err := digest.ParseChallenge(challengeStr) if err != nil { - return nil, err + return nil, fmt.Errorf("invalid challenge %q: %w", challengeStr, err) } toHeader := resp.To() if toHeader == nil {