I'd like to create a custom exception with a constructor taking some context and building its message itself. In Java, that would look like (see how to create custom exception with a number in constructor in Java)
public MyException(String message, IContext context){
super(message + " " + context.someData);
}
In C# however, the compiler tells me that base() is not valid in this context.
public MyException(IContext context)
{
base(String.Format("Context is: {0}", context));
}
What's wrong?