mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
fix: Hack to catch System.Reflection constructor invocation exceptions on crestron
This commit is contained in:
parent
dd3c6b13fd
commit
bbb09666dd
1 changed files with 10 additions and 6 deletions
|
|
@ -209,13 +209,17 @@ namespace ICD.Common.Utils
|
||||||
ConstructorInfo constructor = GetConstructor(type, parameters);
|
ConstructorInfo constructor = GetConstructor(type, parameters);
|
||||||
return constructor.Invoke(parameters);
|
return constructor.Invoke(parameters);
|
||||||
}
|
}
|
||||||
catch (TypeLoadException e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
throw e.GetBaseException();
|
// Crestron sandbox doesn't let us reference System.Reflection types...
|
||||||
}
|
switch (e.GetType().Name)
|
||||||
catch (TargetInvocationException e)
|
{
|
||||||
{
|
case "TypeLoadException":
|
||||||
throw e.GetBaseException();
|
case "TargetInvocationException":
|
||||||
|
throw e.GetBaseException();
|
||||||
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue