How do I extract the exception from the error into the propery status? This doesn't work:
public class MyClass{ public string status { get; set; } public string MyAction() { try { ... status = "OK"; return status; } catch (Exception ex) { //throw ex; status = ex; } } }
Exceptionto astring... Did you mean to dostatus = ex.Message?exis a variable of typeException, andstatusis astring?status = ex.ToString();is what technically does what you're looking for, but I won't say this is a good exception handling design...WebException?