From 0b240cf7d6f374848ab4282527e495a4c2c51ec0 Mon Sep 17 00:00:00 2001 From: Jeff Raymakers Date: Fri, 20 Jun 2025 17:48:09 -0700 Subject: [PATCH] avoid error on cancel (#13) --- .../src/client/classes/DuckDBUIClientConnection.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ts/pkgs/duckdb-ui-client/src/client/classes/DuckDBUIClientConnection.ts b/ts/pkgs/duckdb-ui-client/src/client/classes/DuckDBUIClientConnection.ts index ef68812..4a53048 100644 --- a/ts/pkgs/duckdb-ui-client/src/client/classes/DuckDBUIClientConnection.ts +++ b/ts/pkgs/duckdb-ui-client/src/client/classes/DuckDBUIClientConnection.ts @@ -39,6 +39,8 @@ export class DuckDBUIClientConnection { errorMessage?: string, failure?: (reason: unknown) => void, ) { + // Handle the rejected promise (with a no-op) in case nothing else is, to avoid a console error. + this.requestQueue.enqueuedResult(id).catch(() => {}); this.requestQueue.cancel(id, errorMessage); // If currently running, then interrupt it. if (this.requestQueue.isCurrent(id)) {