I have created a custom exception class like the one below
public class FailedException : Exception { private string failedtext; public FailedException(string message) : base(message) { } public FailedException(string message) : base(message, innerException) { } public string failedtext { get {return failedtext;} set {failedtext = value;} } } I am able to set the property failedtext when throwing the exception, but unable to get the failedtext in my main code; the exception comes as an innerexception, I can see the property but cannot get it. Is there a way to do this?
I want to get the value of failedtext to handle the error. Thanks.