Last Updated: February 25, 2016
·
549
· FotoVerite

Becareful of Rescues

Rescues are awesome and can lead to better manged code. But if you rescue for everything be prepared to hit your head against the wall while you try to understand why your tests fail silently. Rescue for the error you know will happen not for any and all errors.

rescue ActiveRecord::Missing => e

Much better than:

rescue => e