fix exception type when retrying duplicates