public void Notify(object extraData)
{
// If we're a web application, we can report errors automagically
if(HttpContext.Current != null)
{
// If we have errors...
if (HttpContext.Current.AllErrors != null && HttpContext.Current.AllErrors.Any())
{
// ... go through all of the errors and report them
List<Event> events = new List<Event>();
events.Add(ProcessExceptions(
HttpContext.Current.AllErrors.ToList(),
HttpContext.Current.Request.Path,
GetDefaultUserId(),
extraData)
);
// Send the notification:
ErrorNotification notification = new ErrorNotification()
{
Api_Key = this.apiKey,
Events = events
};
SendNotification(notification, this.useSSL);
}
}
// If we're not a web application, we're SOL ATM (call another method)
}