-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Elevate Error of API #80
Comments
Nice idea. I'll try to implement this asap! |
Well, the only actual issue with this is that a full map of the Meta API errors should be created, and there are thousands of them (including sub-codes ofc). |
Your actual listed errors might not be the right one: I mean, there are many codes that can mean the same (or almost) error. |
I think a general ``WhatsAppError |
Yeah that's the point. I opened #88 to also be able to create a better handler at the beginning: in fact, as FB says, version 16 of the API removes subcodes and only has major general codes. |
Meta in their API has specific code for each type error, you can read this error, code and raise exception that we can catch, to know that is wrong in the send message because the error is silent.
2023-04-24 10:04:53,261 - root - INFO - Image not sent to 50763036683 2023-04-24 10:04:53,261 - root - INFO - Status code: 400 2023-04-24 10:04:53,262 - root - ERROR - {'error': {'message': '(#131030) Recipient phone number not in allowed list', 'type': 'OAuthException', 'code': 131030, 'error_data': {'messaging_product': 'whatsapp', 'details': 'El número de teléfono del destinatario no está en la lista de autorizados: Agrega el número de teléfono del destinatario a la lista de destinatarios y vuelve a intentarlo.'}, 'fbtrace_id': 'A4yeLb3JmDl2ZvQMvBgCANu'}}
ObjectIdException
RecipientPhoneNumberException
The text was updated successfully, but these errors were encountered: