From e84c565a437c401f84cfb5991bc550a4d53bb8ab Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Tue, 27 Jul 2021 13:16:55 -0600 Subject: [PATCH] fix: Add logic to check inner exception Some exceptions seem to be getting swallowed by the over-arching TypeLoadException. This checks for an InnerException and prints it's message if there is one. --- .../PepperDashEssentialsBase/Factory/DeviceFactory.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs index ec041853..8b1d4326 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Factory/DeviceFactory.cs @@ -156,6 +156,15 @@ namespace PepperDash.Essentials.Core Debug.Console(0, Debug.ErrorLogLevel.Error, "Exception occurred while creating device {0}: {1}", dc.Key, ex.Message); Debug.Console(2, "{0}", ex.StackTrace); + + if (ex.InnerException == null) + { + return null; + } + + Debug.Console(0, Debug.ErrorLogLevel.Error, "Inner exception while creating device {0}: {1}", dc.Key, + ex.InnerException.Message); + Debug.Console(2, "{0}", ex.InnerException.StackTrace); return null; } }