Validation using exceptions