mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-07 18:24:19 -04:00
Merge pull request #5090 from Ullmie02/plugin-startup-fix
(cherry picked from commit f82e6ee8cccc1d3bdfad44255983387878ed8279) Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
parent
a486cd27a9
commit
524df2e45d
@ -112,8 +112,6 @@ namespace Emby.Server.Implementations.Plugins
|
|||||||
{
|
{
|
||||||
assembly = Assembly.LoadFrom(file);
|
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();
|
assembly.GetExportedTypes();
|
||||||
}
|
}
|
||||||
catch (FileLoadException ex)
|
catch (FileLoadException ex)
|
||||||
@ -122,6 +120,20 @@ namespace Emby.Server.Implementations.Plugins
|
|||||||
ChangePluginState(plugin, PluginStatus.Malfunctioned);
|
ChangePluginState(plugin, PluginStatus.Malfunctioned);
|
||||||
continue;
|
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;
|
||||||
|
}
|
||||||
|
#pragma warning disable CA1031 // Do not catch general exception types
|
||||||
|
catch (Exception ex)
|
||||||
|
#pragma warning restore CA1031 // Do not catch general exception types
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Failed to load assembly {Path}. Unknown exception was thrown. Disabling plugin.", file);
|
||||||
|
ChangePluginState(plugin, PluginStatus.Malfunctioned);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
_logger.LogInformation("Loaded assembly {Assembly} from {Path}", assembly.FullName, file);
|
_logger.LogInformation("Loaded assembly {Assembly} from {Path}", assembly.FullName, file);
|
||||||
yield return assembly;
|
yield return assembly;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user