Skip to content

Commit 526f002

Browse files
committed
Throw plugin exception for plugin dispose interface
1 parent bae0fa5 commit 526f002

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,21 @@ public static async ValueTask DisposePluginsAsync()
8888

8989
private static async Task DisposePluginAsync(PluginPair pluginPair)
9090
{
91-
switch (pluginPair.Plugin)
92-
{
93-
case IDisposable disposable:
94-
disposable.Dispose();
95-
break;
96-
case IAsyncDisposable asyncDisposable:
97-
await asyncDisposable.DisposeAsync();
98-
break;
91+
try
92+
{
93+
switch (pluginPair.Plugin)
94+
{
95+
case IDisposable disposable:
96+
disposable.Dispose();
97+
break;
98+
case IAsyncDisposable asyncDisposable:
99+
await asyncDisposable.DisposeAsync();
100+
break;
101+
}
102+
}
103+
catch (Exception e)
104+
{
105+
throw new FlowPluginException(pluginPair.Metadata, e);
99106
}
100107
}
101108

0 commit comments

Comments
 (0)