-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not log EX MT response check error #826
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #826 +/- ##
=======================================
Coverage 74.56% 74.56%
=======================================
Files 112 112
Lines 13274 13274
=======================================
Hits 9898 9898
Misses 2655 2655
Partials 721 721 ☔ View full report in Codecov by Sentry. |
handlers/external/handler.go
Outdated
@@ -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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I think we want basically the same as ErrResponseUnexpected
but not logged.. so maybe just a new error constant:
var ErrResponseUnexpectedUnlogged error = &SendError{
msg: "response not expected values",
retryable: false,
loggable: false,
clogCode: "response_unexpected",
clogMsg: "Response doesn't match expected values.",
}
9de14f4
to
b73c789
Compare
sender.go
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// ErrResponseUnexpectedUnlogged is same as ErrResponseUnexpected without logging so better for channels where response check is user configured.
b73c789
to
c1cc157
Compare
No description provided.