- Apr 24, 2005
- 553
- 4
- 81
I could make the title sound even less safe for work.. 
In my VB.NET 2005 code, in a Function A, I catch an exception, then wrap it in a friendlier one, and throw it up. The calling function catches it, wraps it in its own friendly description, and throws it up too. Eventually, this bubbles up to the main function, which now needs to show it to the user.
How can I display a chain of nested error messages to the user (or put in a log)? If the original exception from Function A was wrapped and thrown up 5 times, do I do...
MsgBox (Exception.InnerException.InnerException.InnerException.InnerException.InnerException.Message) ?
I also want to include the full stack trace, so do I need to do the same for ...InnerException.InnerException.StackTrace? Sounds insane
Is there a single property or method which will show me the entire chain? ex.ToString works but seems shady.
Thanks!
In my VB.NET 2005 code, in a Function A, I catch an exception, then wrap it in a friendlier one, and throw it up. The calling function catches it, wraps it in its own friendly description, and throws it up too. Eventually, this bubbles up to the main function, which now needs to show it to the user.
How can I display a chain of nested error messages to the user (or put in a log)? If the original exception from Function A was wrapped and thrown up 5 times, do I do...
MsgBox (Exception.InnerException.InnerException.InnerException.InnerException.InnerException.Message) ?
I also want to include the full stack trace, so do I need to do the same for ...InnerException.InnerException.StackTrace? Sounds insane
Is there a single property or method which will show me the entire chain? ex.ToString works but seems shady.
Thanks!
