avoid error on cancel (#13)

This commit is contained in:
Jeff Raymakers
2025-06-20 17:48:09 -07:00
committed by GitHub
parent 0a5add6547
commit 0b240cf7d6

View File

@@ -39,6 +39,8 @@ export class DuckDBUIClientConnection {
errorMessage?: string, errorMessage?: string,
failure?: (reason: unknown) => void, 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); this.requestQueue.cancel(id, errorMessage);
// If currently running, then interrupt it. // If currently running, then interrupt it.
if (this.requestQueue.isCurrent(id)) { if (this.requestQueue.isCurrent(id)) {