Catch BulkSmsZw status errors as python exceptions
You can wrap your code in a try - except to catch unsuccessful and bulksms error messages as normal python exceptions
# this wil throw an exception because of the wrong / not valid username
bulksms = Client(username=<wrong-username>, token=<web-token>)
try:
response = bulksms.send(body="bulk sms ZW api testing", recipients=['2637xxxxxxxx', '2637yyyyyyyy'])
print(response)
exceptExceptionas exc:
print("Encountered an Error: %s"%exc)
Responses
responses are in default JSON format used by BulkSMSZW service
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.