Handle exceptions prior to rails 3.2