Skip to main content
added 27 characters in body
Source Link
Control Freak
  • 13.2k
  • 31
  • 101
  • 150

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; } } } 

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"; } catch (Exception ex) { //throw ex; status = ex; } } } 

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; } } } 
Source Link
Control Freak
  • 13.2k
  • 31
  • 101
  • 150

How to extract exception error to property?

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"; } catch (Exception ex) { //throw ex; status = ex; } } }