I working on a method that does something given a string parameter. A valid value for the string parameter is anything other than null or string.Empty. So my code looks li
This depends on circumstance really.
The question comes down to, is it really an error? By that I mean do you always expect a value? If you do, then probably your best bet here is creating your own Exception, perhaps like so:
class StringEmptyOrNullException : Exception
{
}
Where you can also add your own constructors and added information etc.
If it however is not an "exceptional" happening in your program, if would probably be a better idea to return null from the method and handle it from there. Just remember, Exception's are for exceptional conditions.
Hope this helps,
Kyle