mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
fix: Preserve stack trace when rethrowing inner exceptions
This commit is contained in:
parent
d1f8096933
commit
a55480f8e5
1 changed files with 7 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||||
using Crestron.SimplSharp.Reflection;
|
using Crestron.SimplSharp.Reflection;
|
||||||
#else
|
#else
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Runtime.ExceptionServices;
|
||||||
#endif
|
#endif
|
||||||
using ICD.Common.Properties;
|
using ICD.Common.Properties;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
@ -54,7 +55,12 @@ namespace ICD.Common.Utils.Json
|
||||||
}
|
}
|
||||||
catch (TargetInvocationException e)
|
catch (TargetInvocationException e)
|
||||||
{
|
{
|
||||||
throw e.InnerException;
|
#if SIMPLSHARP
|
||||||
|
throw e.InnerException ?? e;
|
||||||
|
#else
|
||||||
|
ExceptionDispatchInfo.Capture(e.InnerException ?? e).Throw();
|
||||||
|
throw;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue