[openstreetmap-website] Rescue to StandardError instead of Exception (#852)

Andy Allan notifications at github.com
Mon Dec 8 09:17:40 UTC 2014


http://stackoverflow.com/questions/10048173/why-is-it-bad-style-to-rescue-exception-e-in-ruby has a good explanation. In summary, a plain `rescue` rescues all `StandardError`s, whereas rescuing `Exception` rescues a whole bunch of extra things that you don't want to rescue. For example, `Timeout::Error < RuntimeError < StandardError < Exception`, and all Net::HTTP errors are subclassed from `StandardError` too.

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/852#issuecomment-66041530
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20141208/8de07f15/attachment.html>


More information about the rails-dev mailing list