Data bindings UI - Update evaluation status of conditional data bindings

Profiles - Don't fail to activate a module when its last profile fails to load
This commit is contained in:
Robert committed 2021-03-16 19:47:27 +01:00
1 parent 12227b3530
commit 1a7a7e0582
5 files changed
+43 -14

No files matched your search

@@ -20,14 +20,14 @@ namespace Artemis.Core.JsonConverters
{
JValue? jsonValue = serializer.Deserialize<JValue>(reader);
if (jsonValue == null)
throw new FormatException();
throw new JsonReaderException("Failed to deserialize forgiving int value");
if (jsonValue.Type == JTokenType.Float)
return (int) Math.Round(jsonValue.Value<double>());
if (jsonValue.Type == JTokenType.Integer)
return jsonValue.Value<int>();
throw new FormatException();
throw new JsonReaderException("Failed to deserialize forgiving int value");
}
}
}
+11 -6
View File
@@ -47,15 +47,20 @@ namespace Artemis.Core.Services
{
module.Activate(false);
// If this is a profile module, activate the last active profile after module activation
if (module is ProfileModule profileModule)
await _profileService.ActivateLastProfileAnimated(profileModule);
try
{
// If this is a profile module, activate the last active profile after module activation
if (module is ProfileModule profileModule)
await _profileService.ActivateLastProfileAnimated(profileModule);
}
catch (Exception e)
{
_logger.Warning(e, $"Failed to activate last profile on module {module}");
}
}
catch (Exception e)
{
_logger.Error(new ArtemisPluginFeatureException(
module, "Failed to activate module and last profile.", e), "Failed to activate module and last profile"
);
_logger.Error(new ArtemisPluginFeatureException(module, "Failed to activate module.", e), "Failed to activate module");
throw;
}
}