Discard transaction if an exception occurs