When implementing your methods, you might come across scenarios in which you want to throw an exception. For example, I recommend that your nonprivate methods always validate their arguments, and if any argument doesn’t live up to your method’s implicit assumptions, an exception should be thrown. In this case, I recommend that you throw one of the exception classes already defined in the FCL:
I strongly suggest that you throw a specific exception class, a class that has no other classes derived from it. For example, don’t throw an
ArgumentException because it’s too vague, it could mean any of its three derived types, and it doesn’t ...