Close transaction and mark with error on client exception