Skip to content

Commit a88f65a

Browse files
authored
Merge pull request #3536 from Flow-Launcher/error_message
Do not show error message for initialization if plugin is already disabled
2 parents d2e63ab + a73ff5f commit a88f65a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,19 @@ public static async Task InitializePluginsAsync()
220220
catch (Exception e)
221221
{
222222
API.LogException(ClassName, $"Fail to Init plugin: {pair.Metadata.Name}", e);
223-
pair.Metadata.Disabled = true;
224-
pair.Metadata.HomeDisabled = true;
225-
failedPlugins.Enqueue(pair);
223+
if (pair.Metadata.Disabled && pair.Metadata.HomeDisabled)
224+
{
225+
// If this plugin is already disabled, do not show error message again
226+
// Or else it will be shown every time
227+
API.LogDebug(ClassName, $"Skipped init for <{pair.Metadata.Name}> due to error");
228+
}
229+
else
230+
{
231+
pair.Metadata.Disabled = true;
232+
pair.Metadata.HomeDisabled = true;
233+
failedPlugins.Enqueue(pair);
234+
API.LogDebug(ClassName, $"Disable plugin <{pair.Metadata.Name}> because init failed");
235+
}
226236
}
227237
}));
228238

0 commit comments

Comments
 (0)