Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Added special handling for ReflectionTypeLoadException
Browse files Browse the repository at this point in the history
  • Loading branch information
JonAnders committed Feb 19, 2015
1 parent 7731cda commit 6338e17
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/app/SharpRaven/Data/JsonPacket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

using System;
using System.Collections.Generic;
using System.Reflection;

using Newtonsoft.Json;

Expand Down Expand Up @@ -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);
}
}
}


Expand Down

0 comments on commit 6338e17

Please sign in to comment.