tags:

views:

144

answers:

2

When using ELMAH (which is brilliant) is it possible to view extra information that you have added to an exception.

E.g.

Exception ex = new Exception("New exception to use ErrorSignal functionality");
ex.Data.Add("ExtraInfo", "Here is some extra information i would like to be displayed.");
ErrorSignal.FromCurrentContext().Raise(ex);

When I view the exception from elmah.axd it doesn’t seem to show the “ExtraInfo” key and value information, just the exception string.

+2  A: 

No, it is not possible to view the extra information with the current 1.x releases.

Atif Aziz
Atif, I highly recommend adding this feature!
Chris Marisic
Agreed and it's already a logged issue [1]. You can star the issue to follow updates on it.[1] http://code.google.com/p/elmah/issues/detail?id=162
Atif Aziz
A: 

The simple way to go around, is to encapsulate the error. The outer error will contain you custom message.

string msg = "my custom error message";

ErrorSignal.FromCurrentContext().Raise( new Elmah.ApplicationException(msg,ex));

Roma