-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add send error for channel and contact pair limit hit that allow retr… #805
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #805 +/- ##
=======================================
Coverage 74.40% 74.41%
=======================================
Files 112 112
Lines 13493 13496 +3
=======================================
+ Hits 10040 10043 +3
Misses 2718 2718
Partials 735 735 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
4ed6cd4
to
411c508
Compare
handlers/meta/handlers.go
Outdated
@@ -1090,6 +1091,10 @@ func (h *handler) requestWAC(payload whatsapp.SendRequest, accessToken string, r | |||
return courier.ErrResponseUnparseable | |||
} | |||
|
|||
if slices.Index([]int{4, 80007, 130429, 131048, 131056, 133016}, respPayload.Error.Code) > 0 { |
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.
Matching the error codes https://developers.facebook.com/docs/whatsapp/cloud-api/support/error-codes#throttling-errors to all be marked as throttle error and we retry up to 3 times
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.
this is odd way to check if x in y. Save the list of error codes as a global, then use slices.Contains
handlers/meta/handlers.go
Outdated
@@ -1090,6 +1091,10 @@ func (h *handler) requestWAC(payload whatsapp.SendRequest, accessToken string, r | |||
return courier.ErrResponseUnparseable | |||
} | |||
|
|||
if slices.Index([]int{4, 80007, 130429, 131048, 131056, 133016}, respPayload.Error.Code) > 0 { |
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.
this is odd way to check if x in y. Save the list of error codes as a global, then use slices.Contains
0c0ed26
to
3693fe4
Compare
…ying the message