Closed mikeymicrophone closed 7 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!
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!