Handle general exceptions during plugin loading.
This commit is contained in:
parent
95db12de72
commit
62dd6730e8
1 changed files with 8 additions and 0 deletions
|
|
@ -85,12 +85,20 @@ namespace Observatory.PluginManagement
|
|||
errorList.Add((FormatErrorMessage(ex), ex.StackTrace));
|
||||
errorPlugins.Add(plugin);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorList.Add(($"{plugin.ShortName}: {ex.Message}", ex.StackTrace));
|
||||
errorPlugins.Add(plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
notifyPlugins.RemoveAll(n => errorPlugins.Contains(n.plugin));
|
||||
|
||||
core.Notification += pluginHandler.OnNotificationEvent;
|
||||
|
||||
if (errorList.Any())
|
||||
ErrorReporter.ShowErrorPopup("Plugin Load Error" + (errorList.Count > 1 ? "s" : String.Empty), errorList);
|
||||
}
|
||||
|
||||
private static string FormatErrorMessage(PluginException ex)
|
||||
|
|
|
|||
Loading…
Reference in a new issue