From 6338e1741aee7817935e7cc7f0b5b56fd8d3d2af Mon Sep 17 00:00:00 2001 From: JonAnders Date: Thu, 19 Feb 2015 16:28:32 +0100 Subject: [PATCH] Added special handling for ReflectionTypeLoadException --- src/app/SharpRaven/Data/JsonPacket.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/app/SharpRaven/Data/JsonPacket.cs b/src/app/SharpRaven/Data/JsonPacket.cs index fd01af92..286718f5 100644 --- a/src/app/SharpRaven/Data/JsonPacket.cs +++ b/src/app/SharpRaven/Data/JsonPacket.cs @@ -30,6 +30,7 @@ using System; using System.Collections.Generic; +using System.Reflection; using Newtonsoft.Json; @@ -82,6 +83,18 @@ public JsonPacket(string project, Exception exception) Exceptions.Add(sentryException); } + + // ReflectionTypeLoadException doesn't contain much useful info in itself, and needs special handling + ReflectionTypeLoadException reflectionTypeLoadException = exception as ReflectionTypeLoadException; + if (reflectionTypeLoadException != null) + { + foreach (Exception loaderException in reflectionTypeLoadException.LoaderExceptions) + { + SentryException sentryException = new SentryException(loaderException); + + Exceptions.Add(sentryException); + } + } }