twilio-java icon indicating copy to clipboard operation
twilio-java copied to clipboard

Add Error description json to twilio-java

Open DmitryNeverovich opened this issue 4 years ago • 1 comments

Do you have any plans to add errorCodes and errorDescription to Twilio java library?

Twilio error codes: https://www.twilio.com/docs/api/errors Twilio error codes json: https://www.twilio.com/docs/documents/76/twilio-error-codes.json

Reason: some twilio callbacks return only 'errorCode' without any 'error description'. Callbacks do not include 'error description'. For example: I send twilio sms message, request was failed with error code 21408. Application received error code 21408 from twilio callback url. The callback url call does not includes error description or error message in parameters. As workaround I requested message by SID, but I see following: "errorCode:21408" and "error_message: null". I think more reliable to extract error message from twilio json (https://www.twilio.com/docs/documents/76/twilio-error-codes.json) and avoid additional rest call to twilio.

DmitryNeverovich avatar Dec 11 '20 12:12 DmitryNeverovich

There is currently no plan at this time to add errorCodes and errorDescriptions to the Twilio Java library. I've nothing against it so open to a PR to add support if you see fit.

JenniferMah avatar Dec 12 '20 00:12 JenniferMah