Skip to content

Commit cb71302

Browse files
committed
Don't error when closing/killing disconnected proxy
1 parent 75c6228 commit cb71302

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/protocol/src/browser/client.ts

+7
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,13 @@ export class Client {
176176
*/
177177
private async remoteCall(proxyId: number | Module, method: string, args: any[]): Promise<any> {
178178
if (this.disconnected && typeof proxyId === "number") {
179+
// Can assume killing or closing works because a disconnected proxy
180+
// is disposed on the server's side.
181+
switch (method) {
182+
case "close":
183+
case "kill":
184+
return Promise.resolve();
185+
}
179186
return Promise.reject(
180187
new Error(`Unable to call "${method}" on proxy ${proxyId}: disconnected`),
181188
);

0 commit comments

Comments
 (0)