Skip to content

Commit

Permalink
Do not log EX MT response check error
Browse files Browse the repository at this point in the history
  • Loading branch information
norkans7 committed Jan 9, 2025
1 parent 47e0838 commit 9de14f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion handlers/external/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.ErrFailedWithReason("mt-response-check", fmt.Sprintf("response not containing '%s'", responseCheck))
}
}

Expand Down
2 changes: 1 addition & 1 deletion handlers/external/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ var xmlSendWithResponseContentTestCases = []OutgoingTestCase{
Headers: map[string]string{"Content-Type": "text/xml; charset=utf-8"},
Body: `<msg><to>+250788383383</to><text>Error Message</text><from>2020</from><quick_replies></quick_replies></msg>`,
}},
ExpectedError: courier.ErrResponseUnexpected,
ExpectedError: courier.ErrFailedWithReason("mt-response-check", "response not containing '<return>0</return>'"),
},
{
Label: "Send Attachment",
Expand Down

0 comments on commit 9de14f4

Please sign in to comment.