diff --git a/handlers/meta/handlers.go b/handlers/meta/handlers.go index baa9bc88..8ea413d9 100644 --- a/handlers/meta/handlers.go +++ b/handlers/meta/handlers.go @@ -1090,6 +1090,10 @@ func (h *handler) requestWAC(payload whatsapp.SendRequest, accessToken string, r return courier.ErrResponseUnparseable } + if respPayload.Error.Code == 131056 { + return courier.ErrConnectionThrottled + } + if respPayload.Error.Code != 0 { return courier.ErrFailedWithReason(strconv.Itoa(respPayload.Error.Code), respPayload.Error.Message) } diff --git a/handlers/meta/whataspp_test.go b/handlers/meta/whataspp_test.go index 6484e0f4..24bac9b3 100644 --- a/handlers/meta/whataspp_test.go +++ b/handlers/meta/whataspp_test.go @@ -678,6 +678,17 @@ var whatsappOutgoingTests = []OutgoingTestCase{ }, ExpectedError: courier.ErrResponseUnparseable, }, + { + Label: "Error Channel Contact Pair limit hit", + MsgText: "Pair limit", + MsgURN: "whatsapp:250788123123", + MockResponses: map[string][]*httpx.MockResponse{ + "*/12345_ID/messages": { + httpx.NewMockResponse(403, nil, []byte(`{ "error": {"message": "(#131056) (Business Account, Consumer Account) pair rate limit hit","code": 131056 }}`)), + }, + }, + ExpectedError: courier.ErrConnectionThrottled, + }, { Label: "Error", MsgText: "Error",