Comments
2 comments
-
Hi there,
Thank you for your post!
We've got a feature request to add the exception data to the default exception reporting templates (with internal reference SA-264) and I've +1'd this request with your information--thank you for your feedback!
Many thanks as well for sharing your solution for this.
-
One of the other interesting things you can do with this is make the exception reporter behave differently when you set a certain value.
For example I used it to be able to send some reports silently without user interaction (Visible = false; ShowInTaskbar = false; and some other small hacks needed).
Add comment
Please sign in to leave a comment.
readonly List<string> _keys = new List<string>(); readonly List<string> _values = new List<string>(); public ExceptionReportingForm(UnhandledExceptionHandler unhandledExceptionHandler, ReportExceptionEventArgs reportExceptionEventArgs) : this() { int newHeight = Height; try { _values.AddRange(from object value in reportExceptionEventArgs.Exception.Data.Values select value.ToString()); _keys.AddRange(from object key in reportExceptionEventArgs.Exception.Data.Keys select key.ToString()); int countOnlyOnce = _keys.Count; for (int i = 0; i < countOnlyOnce; i++) { reportExceptionEventArgs.AddCustomProperty(_keys[i], _values[i]); } } catch (Exception) {}Why isn't something like this added to the defualt exception handlers?