Please see question embedded in comment below.
public class CustomException : Exception
{
private readonly string _customField;
public CustomException(string customField, string message)
: base(message)
{
// What's the best way to reuse the customField initialization code in the
// overloaded constructor? Something like this(customField)
}
public CustomException(string customField)
{
_customField = customField;
}
}
I'm open to considering alternative implementations that reuse the base constructor and minimize initialization code. I'd like to keep the _customField readonly, which is not possible if I extract a separate initialization method.