Skip to content

Commit a630d14

Browse files
committed
Tweak ErrResponseContent
1 parent 60d1e6c commit a630d14

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Diff for: sender.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ var ErrConnectionThrottled error = &SendError{
8383
clogMsg: "Connection to server has been rate limited.",
8484
}
8585

86-
// ErrResponseStatus should be returned when channel the response has a non-success status code
86+
// ErrResponseStatus should be returned when the response from the channel has a non-success status code
8787
var ErrResponseStatus error = &SendError{
8888
msg: "response status code",
8989
retryable: false,
@@ -92,6 +92,15 @@ var ErrResponseStatus error = &SendError{
9292
clogMsg: "Response has non-success status code.",
9393
}
9494

95+
// ErrResponseContent should be returned when the response content from the channel indicates non-succeess
96+
var ErrResponseContent error = &SendError{
97+
msg: "response content",
98+
retryable: false,
99+
loggable: false,
100+
clogCode: "response_content",
101+
clogMsg: "Response content indicates non-success.",
102+
}
103+
95104
// ErrResponseUnparseable should be returned when channel response can't be parsed in expected format
96105
var ErrResponseUnparseable error = &SendError{
97106
msg: "response couldn't be parsed",
@@ -110,15 +119,6 @@ var ErrResponseUnexpected error = &SendError{
110119
clogMsg: "Response doesn't match expected values.",
111120
}
112121

113-
// ErrResponseContent is same as ErrResponseUnexpected without logging so better for channels where response check is user configured. We conside this message failed when the response content is unexpected
114-
var ErrResponseContent error = &SendError{
115-
msg: "response not expected values",
116-
retryable: false,
117-
loggable: false,
118-
clogCode: "response_unexpected",
119-
clogMsg: "Response doesn't match expected values.",
120-
}
121-
122122
// ErrContactStopped should be returned when channel tells us explicitly that the contact has opted-out
123123
var ErrContactStopped error = &SendError{
124124
msg: "contact opted out",

0 commit comments

Comments
 (0)