Skip to content

Elevate Error of API #80

@vidm27

Description

@vidm27

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

	"error": {
		"message": "Unsupported post request. Object with ID '118130101241809' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https:\/\/developers.facebook.com\/docs\/graph-api",
		"type": "GraphMethodException",
		"code": 100,
		"error_subcode": 33,
		"fbtrace_id": "A2H9tBUK0RHUB91NwUjrY23"
	}
}

RecipientPhoneNumberException

	"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": "AguKtar08vzPr310wo-jcjY"
	}
} 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions