Skip to content

Commit 35396f4

Browse files
committed
Report errors sending cancellation
1 parent 2cc3bc8 commit 35396f4

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/shared/protocol.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -418,14 +418,18 @@ export abstract class Protocol<
418418
this._responseHandlers.delete(messageId);
419419
this._progressHandlers.delete(messageId);
420420

421-
this._transport?.send({
422-
jsonrpc: "2.0",
423-
method: "cancelled",
424-
params: {
425-
requestId: messageId,
426-
reason: String(reason),
427-
},
428-
});
421+
this._transport
422+
?.send({
423+
jsonrpc: "2.0",
424+
method: "cancelled",
425+
params: {
426+
requestId: messageId,
427+
reason: String(reason),
428+
},
429+
})
430+
.catch((error) =>
431+
this._onerror(new Error(`Failed to send cancellation: ${error}`)),
432+
);
429433

430434
reject(reason);
431435
};

0 commit comments

Comments
 (0)