fix: allow enabling + loading a devPlugin if it has failed to load

This commit is contained in:
goat 2023-05-22 19:03:54 +02:00
parent b897dbcc2d
commit 880095428c
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -316,8 +316,13 @@ internal class LocalPlugin : IDisposable
case PluginState.Loaded:
throw new InvalidPluginOperationException($"Unable to load {this.Name}, already loaded");
case PluginState.LoadError:
throw new InvalidPluginOperationException(
$"Unable to load {this.Name}, load previously faulted, unload first");
if (!this.IsDev)
{
throw new InvalidPluginOperationException(
$"Unable to load {this.Name}, load previously faulted, unload first");
}
break;
case PluginState.UnloadError:
if (!this.IsDev)
{
@ -580,7 +585,9 @@ internal class LocalPlugin : IDisposable
case PluginState.Unloading:
case PluginState.Loaded:
case PluginState.LoadError:
throw new InvalidPluginOperationException($"Unable to enable {this.Name}, still loaded");
if (!this.IsDev)
throw new InvalidPluginOperationException($"Unable to enable {this.Name}, still loaded");
break;
case PluginState.Unloaded:
break;
case PluginState.UnloadError: