[CB-2733] Consistently throw an Error object.