Handling exceptions within a transaction