aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Plugins/PluginManager.cs
diff options
context:
space:
mode:
authorDavid <daullmer@gmail.com>2021-01-24 13:34:22 +0100
committerDavid <daullmer@gmail.com>2021-01-24 13:34:22 +0100
commit677bba742e343271be39d4da6d10eca9720c0403 (patch)
tree98a5769762cbf8f6e47cfd136b7ee2dc6eabc9c8 /Emby.Server.Implementations/Plugins/PluginManager.cs
parent80f3e20394bc249914ddcb430b4f6d63761ebd29 (diff)
Remove try-catch nesting
Diffstat (limited to 'Emby.Server.Implementations/Plugins/PluginManager.cs')
-rw-r--r--Emby.Server.Implementations/Plugins/PluginManager.cs17
1 files changed, 7 insertions, 10 deletions
diff --git a/Emby.Server.Implementations/Plugins/PluginManager.cs b/Emby.Server.Implementations/Plugins/PluginManager.cs
index 9621b34b6..de4b71433 100644
--- a/Emby.Server.Implementations/Plugins/PluginManager.cs
+++ b/Emby.Server.Implementations/Plugins/PluginManager.cs
@@ -112,16 +112,7 @@ namespace Emby.Server.Implementations.Plugins
{
assembly = Assembly.LoadFrom(file);
- 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;
- }
+ assembly.GetExportedTypes();
}
catch (FileLoadException ex)
{
@@ -129,6 +120,12 @@ namespace Emby.Server.Implementations.Plugins
ChangePluginState(plugin, PluginStatus.Malfunctioned);
continue;
}
+ 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;
+ }
_logger.LogInformation("Loaded assembly {Assembly} from {Path}", assembly.FullName, file);
yield return assembly;