Skip to content
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

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Conversation

norkans7
Copy link
Contributor

@norkans7 norkans7 commented Jan 9, 2025

No description provided.

@norkans7 norkans7 requested a review from rowanseymour January 9, 2025 14:56
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.56%. Comparing base (47e0838) to head (c1cc157).

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.
📢 Have feedback on the report? Share it here.

@@ -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))
Copy link
Member

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.",
}

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
Copy link
Member

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.

@norkans7 norkans7 requested a review from rowanseymour January 9, 2025 16:49
@rowanseymour rowanseymour merged commit 6259ba2 into main Jan 9, 2025
7 checks passed
@rowanseymour rowanseymour deleted the EX-response-check branch January 9, 2025 20:14
@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants