catching generic sql exceptions