Prevent crash when constructor for an Editor throws an exception
This commit is contained in:
parent
50ca3678e7
commit
c867eb3250
@ -59,6 +59,10 @@ namespace UniversalEditor.UserInterface.Common
|
||||
{
|
||||
Console.WriteLine("binding error: " + ex.InnerException.Message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("error while loading editor '" + type.FullName + "': " + ex.Message);
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endregion
|
||||
@ -69,11 +73,15 @@ namespace UniversalEditor.UserInterface.Common
|
||||
{
|
||||
IOptionPanelImplementation editor = (type.Assembly.CreateInstance(type.FullName) as IOptionPanelImplementation);
|
||||
listOptionPanels.Add(editor);
|
||||
}
|
||||
catch (System.Reflection.TargetInvocationException ex)
|
||||
{
|
||||
throw ex.InnerException;
|
||||
}
|
||||
}
|
||||
catch (System.Reflection.TargetInvocationException ex)
|
||||
{
|
||||
Console.WriteLine("binding error: " + ex.InnerException.Message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("error while loading editor '" + type.FullName + "': " + ex.Message);
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endregion
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user