Right, I know I am totally going to look an idiot with this one, but my brain is just not kicking in to gear this morning.
I want to have a method where I can sa
I think seeing as all exceptions should have a parameterless constructor, and have the Message
property, so the following should work:
static ExType TestException(string message) where ExType:Exception
{
ExType ex = new ExType();
ex.Message = message;
return ex;
}
Edit: OK, Message is read only, so you'll have to hope the class implements the Exception(string) constructor instead.
static ExType TestException(string message) where ExType:Exception
{
return new ExType(message);
}