Skip to content

Commit cea1fcf

Browse files
committed
skip if method not found
1 parent 59f3eee commit cea1fcf

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPluginV2.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Threading;
66
using System.Threading.Tasks;
77
using Flow.Launcher.Core.Plugin.JsonRPCV2Models;
8+
using Flow.Launcher.Infrastructure.Logger;
89
using Flow.Launcher.Plugin;
910
using Microsoft.VisualStudio.Threading;
1011
using StreamJsonRpc;
@@ -141,7 +142,20 @@ public virtual Task ReloadDataAsync()
141142

142143
public virtual async ValueTask DisposeAsync()
143144
{
144-
await RPC.InvokeAsync("close");
145+
try
146+
{
147+
await RPC.InvokeAsync("close");
148+
}
149+
catch (RemoteMethodNotFoundException e)
150+
{
151+
}
152+
catch (Exception e)
153+
{
154+
Log.Exception(
155+
$"Exception when calling close method for plugin <{Context.CurrentPluginMetadata.Name}>",
156+
e);
157+
}
158+
145159
RPC?.Dispose();
146160
ErrorStream?.Dispose();
147161
}

0 commit comments

Comments
 (0)