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

Distinguish between internal errors and network errors.

Open hovissimo opened this issue 2 years ago • 1 comments

Issue Summary

Distinguish between internal errors and network errors.

I want to retry calls to Twilio on network errors, but not on internal (actual) errors. The implementation isn't very consistent about what a TwilioError is, and when it should be raised.

https://github.com/search?q=repo%3Atwilio%2Ftwilio-ruby%20Twilio%3A%3AREST%3A%3ATwilioError&type=code image

Can we please either NOT re-raise Faraday::Error and just let it bubble up, or re-raise these errors as a new Twilio::REST::NetworkError so that consumers can better distinguish between network errors and non-network errors?

Steps to Reproduce

N/A

Code Snippet

N/A

Exception/Log

Twilio::REST::TwilioError:  Failed to open TCP connection to conversations.twilio.com:443 (getaddrinfo: Temporary failure in name resolution)

Technical details:

  • twilio-ruby version: 6.8.0
  • ruby version: irrelevant

hovissimo avatar Oct 27 '23 21:10 hovissimo

👋 Hi @hovissimo, thanks for reporting this issue!

Our Agent TwiDI has started analyzing and prioritizing this request.
Here’s what will happen next:

  • A PR will be created to address this issue.
  • The PR will be reviewed by our team members.
  • On approval, the PR will be merged into the main branch.
  • Once merged, the issue will be closed automatically and changes will be available in the next release.

⏳ Sit tight — we’ll keep you updated as we make progress.

twilio-dx avatar Sep 12 '25 12:09 twilio-dx