I am using IErrorHandler to catch ApplicationExceptions.
The HandleError method of IErrorHandler accepts an Exception as input.
I am throwing customExceptions in my code if user data is invalid. HandleError is catching them just fine.
My question is: Is there a way to attach/or get the input data the method was using where the Exception took place and attach that data somehow to the method? Or add another parameter to the constructor of my customException that can hold the input data to the method?
//sample constructor to customExceptio
public AddressException(string message): base(message)
{
}
If I add another parameter string InputData..
1. How do I do that?
2. How do I get the InputData data out of the customException on the HandleError side?
public bool HandleError(Exception error)
Should/Could be something like this.
Then you can just access whatever data you passed to the contructor when you handle the Exception.