diff options
| author | David <daullmer@gmail.com> | 2021-01-24 13:22:04 +0100 |
|---|---|---|
| committer | David <daullmer@gmail.com> | 2021-01-24 13:22:04 +0100 |
| commit | 80f3e20394bc249914ddcb430b4f6d63761ebd29 (patch) | |
| tree | 456900d0cc96a6e55f9ba9fe52e0d1662dc950fc /Emby.Server.Implementations/Plugins/PluginManager.cs | |
| parent | 4adbbb9f5111d2386f1f0a9c5aaa173d041e9c90 (diff) | |
Change plugin error message
Diffstat (limited to 'Emby.Server.Implementations/Plugins/PluginManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Plugins/PluginManager.cs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/Plugins/PluginManager.cs b/Emby.Server.Implementations/Plugins/PluginManager.cs index 42c76bd66..9621b34b6 100644 --- a/Emby.Server.Implementations/Plugins/PluginManager.cs +++ b/Emby.Server.Implementations/Plugins/PluginManager.cs @@ -112,9 +112,16 @@ namespace Emby.Server.Implementations.Plugins { assembly = Assembly.LoadFrom(file); - // This force loads all reference dll's that the plugin uses in the try..catch block. - // Removing this will cause JF to bomb out if referenced dll's cause issues. - assembly.GetExportedTypes(); + try + { + assembly.GetExportedTypes(); + } + catch (TypeLoadException ex) // Undocumented exception + { + _logger.LogError(ex, "Failed to load assembly {Path}. This error occurs when a plugin references an incompatible version of one of the shared libraries. Disabling plugin.", file); + ChangePluginState(plugin, PluginStatus.NotSupported); + continue; + } } catch (FileLoadException ex) { @@ -122,12 +129,6 @@ namespace Emby.Server.Implementations.Plugins ChangePluginState(plugin, PluginStatus.Malfunctioned); continue; } - catch (TypeLoadException ex) - { - _logger.LogError(ex, "Failed to load assembly {Path}. Disabling plugin. This is probably caused by an incompatible plugin version.", file); - ChangePluginState(plugin, PluginStatus.Malfunctioned); - continue; - } _logger.LogInformation("Loaded assembly {Assembly} from {Path}", assembly.FullName, file); yield return assembly; |
