twilio / twilio-java

A Java library for communicating with the Twilio REST API and generating TwiML.
MIT License
484 stars 425 forks source link

Add Error description json to twilio-java #611

Open DmitryNeverovich opened 3 years ago

DmitryNeverovich commented 3 years ago

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.

JenniferMah commented 3 years ago

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.