vonage-python-sdk icon indicating copy to clipboard operation
vonage-python-sdk copied to clipboard

Exception handling

Open creatingwake opened this issue 4 years ago • 3 comments

Current SDK does not handle exceptions well.

As a user of the SDK I expect the SDK to catch all exceptions related to events internal to the SDK and return me an appropriate status code in the event of an unrecoverable exception which results in failure.

Alternatively/additionally, as a user of the SDK I expect all unhandled exceptions raised by the SDK to be documented so I may catch them and implement appropriate handling.

Example: Using the SMS API and calling send_message I experienced a traceback due to unhandled exceptions which occurred within the Vonage-python-sdk relating to connection errors with the Vonage API endpoint. Upon checking the documentation there is no list of possible exceptions the SDK may raise so it is not possible to determine which exceptions I need to catch to avoid suffering further failures. For simplicity, I expect the SDK to handle exceptions internally and pass me an appropriate status result.

creatingwake avatar Mar 29 '21 17:03 creatingwake

+1

I have been experiencing the same thing. I'm seeing this with the Voice API and the input action for an NCCO. If the input action type is "speech" and the user does not say anything, nothing is raised.

anthonyjdella avatar Mar 01 '22 05:03 anthonyjdella

Hi @creatingwake I have added error handling for internal Vonage errors where a 200 is returned to the SDK, which is on the v4.x branch and will be released soon. I will close this issue when it goes live.

maxkahan avatar Jan 13 '23 17:01 maxkahan

@anthonyjdella Thanks for your input as well. The "speech" input type has a default timeout value of 10s in the startTimeout field, though this can be customised.

I will record this for investigation when I have time. If you're still having problems, feel free to open an issue or PR specific to this, or reach out to us on https://developer.vonage.com/community/slack

maxkahan avatar Jan 13 '23 17:01 maxkahan