catch database exceptions gracefully