UI - Improved exception dialog shown at early startup failure

Plugins - Provide a better error message on built in plugin installation failure
Conditions - Added better null/not null checks for strings
This commit is contained in:
Robert committed 2021-04-10 19:32:21 +02:00
1 parent c66c21152f
commit 992657b0c5
6 files changed
+94 -11

No files matched your search

@@ -98,11 +98,19 @@ namespace Artemis.Core.Services
}
else
{
PluginInfo pluginInfo;
try
{
// Compare versions, copy if the same when debugging
PluginInfo pluginInfo = CoreJson.DeserializeObject<PluginInfo>(File.ReadAllText(metadataFile))!;
pluginInfo = CoreJson.DeserializeObject<PluginInfo>(File.ReadAllText(metadataFile))!;
}
catch (Exception e)
{
throw new ArtemisPluginException($"Failed read plugin metadata needed to install built-in plugin: {e.Message}", e);
}
try
{
if (builtInPluginInfo.Version > pluginInfo.Version)
{
_logger.Debug("Copying updated built-in plugin from {pluginInfo} to {builtInPluginInfo}", pluginInfo, builtInPluginInfo);
@@ -111,7 +119,7 @@ namespace Artemis.Core.Services
}
catch (Exception e)
{
throw new ArtemisPluginException("Failed read plugin metadata needed to install built-in plugin", e);
throw new ArtemisPluginException($"Failed to install built-in plugin: {e.Message}", e);
}
}
}
@@ -61,6 +61,8 @@ namespace Artemis.Core.Services
RegisterConditionOperator(Constants.CorePlugin, new StringStartsWithConditionOperator());
RegisterConditionOperator(Constants.CorePlugin, new StringEndsWithConditionOperator());
RegisterConditionOperator(Constants.CorePlugin, new StringMatchesRegexConditionOperator());
RegisterConditionOperator(Constants.CorePlugin, new StringNullConditionOperator());
RegisterConditionOperator(Constants.CorePlugin, new StringNotNullConditionOperator());
// Null checks, at the bottom
// TODO: Implement a priority mechanism