Why does .NET's StringValidator's Validate method throws an exception when it doesn't succeed?
问题 As you can see in the MSDN StringValidator documentation, the Validate method returns void . If validation doesn't succeed the Validate method throws ArgumentException . I thought that "You only throw an exception when something exceptional happens". Surely a validator that failed to validate isn't exceptional.. Why not return bool? What am I missing here? Is this a "style issue" (i.e. if it was returning bool, it would still be correct, but just different style)? Note: Method CanValidate may