Closed bezzad closed 9 years ago
A dictionary of key/value data added to ExceptionHandler
class, so that will be stored in exceptions as additional data.
public static Dictionary<string, string> AttachExtraData = new Dictionary<string, string>();
So when any exceptions raised then the additional data also added to exception object.
// Attach extra data to error object
foreach (var item in AttachExtraData)
exp.Data.Add(item.Key, item.Value);
Now, you can to add extra data to any happened exceptions from app. For example:
// Add extra data for labeling exceptions
ExceptionHandler.AttachExtraData.Add("TestKey", "beta version");
Some times we need to have difference between one application on two computers by duplicate user info, so no different between both of them and we need to add some property to all Errors for sign that app exceptions in database. In
ExpHandlerEngine.Start
must be have a parameters to give the custom object.