Skip to content

Instantly share code, notes, and snippets.

@niemyjski
Created April 9, 2015 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niemyjski/620fe74b8aadd7f9ce51 to your computer and use it in GitHub Desktop.
Save niemyjski/620fe74b8aadd7f9ce51 to your computer and use it in GitHub Desktop.
[TEST] Verify an AggregateException's inner exceptions are being reported.
using System;
using Exceptionless.Plugins;
namespace Exceptionless.SampleConsole.Plugins {
[Priority(1)]
public class VerifyAggregateException : IEventPlugin {
public void Run(EventPluginContext context) {
if (!context.Event.IsError() || !context.ContextData.HasException())
return;
var ag = context.ContextData.GetException() as AggregateException;
if (ag == null)
return;
// Set property will auto increment the name with an int.
foreach (var innerException in ag.InnerExceptions)
context.Event.SetProperty("AggregateInnerException", innerException.ToString());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment