Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes Exceptions to Errors #232

Closed
wants to merge 3 commits into from

Conversation

philnash
Copy link
Contributor

@philnash philnash commented Sep 7, 2016

  • Moves twilio-ruby/framework/exception.rb to twilio-ruby/error.rb
    • This follows convention in other ruby libraries, I checked faraday, twitter and koala
  • Errors inherit from StandardError instead of Exception
    • So that they can be caught by a plain rescue
  • Errors renamed to reflect they are errors not exceptions
  • Raising REST errors renamed to use Twilio::RestError and method name error, not exception
  • Renames non-generated usage of Twilio::REST::TwilioException to Twilio::TwilioError

Note, the tests are horribly broken because the Twilio::REST::TwilioException is being tested for in every api call. This is generated code so will make an update to the code generator to fix this. This PR and the resultant update to the generator should be merged at the same time or things will be really broken.

Moves twilio-ruby/framework/exception.rb to twilio-ruby/error.rb.
Errors inherit from StandardError instead of Exception.
Errors renamed to reflect they are errors not exceptions.
Raising REST errors renamed to use Twilio::RestError and method name error, not exception
Only updates non-generated files that contain a reference to the old Twilio::REST::TwilioException.
@ghost
Copy link

ghost commented May 19, 2017

Addressed in next-gen branch.

@ghost ghost closed this May 19, 2017
@philnash
Copy link
Contributor Author

@tmconnors This PR was against the next-gen branch and I don't see a commit that does the equivalent. I noticed that the generator now tests for Twilio::REST::TwilioError. Do you need me to update this PR to make the error class exist within the Twilio::REST module?

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant