aweber / AWeber-API-Ruby-Library

DEPRECATED - Ruby interface to AWeber's API.
http://www.aweber.com
BSD 3-Clause "New" or "Revised" License
25 stars 18 forks source link

exceptions should inherit from StandardError, not Exception #26

Closed mikeymicrophone closed 7 years ago

mikeymicrophone commented 10 years ago

Exception is a class used for a few things besides just control flow. It's not feasible to rescue Exception. http://stackoverflow.com/questions/10048173/why-is-it-bad-style-to-rescue-exception-e-in-ruby

If I want to rescue all exceptions coming from AWeber, I currently have to do it like so.

rescue StandardError, AWeber::OAuthError, AWeber::NotFoundError, AWeber::UnknownRequestError, AWeber::RateLimitError, AWeber::ForbiddenRequestError, AWeber::CreationError => error

It would be nice if I could just shorten that to

rescue StandardError => error

Please revise aweber.rb so that your custom exceptions inherit from StandardError (or a subclass thereof). Thanks!