Add begin/rescue block when saving a record.