Skip to content

Instantly share code, notes, and snippets.



Last active Dec 15, 2020
What would you like to do?
Exceptionless Ignore Third Party Exceptions
// Create our own client instance so we aren't conflicting if anyone else is using exceptionless in an addon.
private readonly ExceptionlessClient _client = new ExceptionlessClient();
private class IgnoreLicensingAndNonGeneratorExceptionsPlugin : IEventPlugin {
private static readonly List<string> _handledNamespaces = new List<string> {
public void Run(EventPluginContext ctx) {
if (!ctx.ContextData.IsUnhandledError || !ctx.Event.IsError() || !ctx.ContextData.HasException())
var exception = ctx.ContextData.GetException();
if (exception == null)
var error = ctx.Event.GetError();
if (error == null)
//Ignore any unhandled exceptions that were not thrown by our code.
if (!error.StackTrace.Select(s => s.DeclaringNamespace).Distinct().Any(ns => _handledNamespaces.Any(ns.Contains)))
ctx.Cancel = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment