mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-19 23:46:49 +00:00
feat: Enhance plugin version check with error handling and logging
This commit is contained in:
parent
af7411f43b
commit
d1501d2dab
1 changed files with 18 additions and 3 deletions
|
|
@ -356,10 +356,18 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig, IInitialization
|
|||
|
||||
private void CheckPluginVersionsAgainstConfig()
|
||||
{
|
||||
var versions = ConfigReader.ConfigObject.Versions;
|
||||
|
||||
if (versions != null)
|
||||
try
|
||||
{
|
||||
Debug.LogInformation("Checking plugin versions against config...");
|
||||
|
||||
if (ConfigReader.ConfigObject == null)
|
||||
return;
|
||||
|
||||
var versions = ConfigReader.ConfigObject.Versions;
|
||||
|
||||
if (versions == null)
|
||||
return;
|
||||
|
||||
var pluginVersions = PluginLoader.EssentialsPluginAssemblies
|
||||
.Select(a =>
|
||||
{
|
||||
|
|
@ -383,6 +391,8 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig, IInitialization
|
|||
}
|
||||
}
|
||||
|
||||
if (versions.Packages == null)
|
||||
return;
|
||||
|
||||
foreach (var version in versions.Packages)
|
||||
{
|
||||
|
|
@ -402,6 +412,11 @@ public class ControlSystem : CrestronControlSystem, ILoadConfig, IInitialization
|
|||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
InitializationExceptions.Add(ex);
|
||||
Debug.LogMessage(ex, "Error checking plugin versions against config. Continuing with load.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue