diff --git a/handlers/external/handler.go b/handlers/external/handler.go index 29e467d9d..e9fdf1296 100644 --- a/handlers/external/handler.go +++ b/handlers/external/handler.go @@ -366,7 +366,7 @@ func (h *handler) Send(ctx context.Context, msg courier.MsgOut, res *courier.Sen } if responseCheck != "" && !strings.Contains(string(respBody), responseCheck) { - return courier.ErrResponseUnexpected + return courier.ErrResponseUnexpectedUnlogged } } diff --git a/handlers/external/handler_test.go b/handlers/external/handler_test.go index ba48779e7..9ed33b7f0 100644 --- a/handlers/external/handler_test.go +++ b/handlers/external/handler_test.go @@ -834,7 +834,7 @@ var xmlSendWithResponseContentTestCases = []OutgoingTestCase{ Headers: map[string]string{"Content-Type": "text/xml; charset=utf-8"}, Body: `+250788383383Error Message2020`, }}, - ExpectedError: courier.ErrResponseUnexpected, + ExpectedError: courier.ErrResponseUnexpectedUnlogged, }, { Label: "Send Attachment", diff --git a/sender.go b/sender.go index e5d3ea843..1e592360a 100644 --- a/sender.go +++ b/sender.go @@ -110,6 +110,15 @@ var ErrResponseUnexpected error = &SendError{ clogMsg: "Response doesn't match expected values.", } +// ErrResponseUnexpectedUnlogged should be returned when channel response doesn't match what we expect and unlogged +var ErrResponseUnexpectedUnlogged error = &SendError{ + msg: "response not expected values", + retryable: false, + loggable: false, + clogCode: "response_unexpected", + clogMsg: "Response doesn't match expected values.", +} + // ErrContactStopped should be returned when channel tells us explicitly that the contact has opted-out var ErrContactStopped error = &SendError{ msg: "contact opted out",