diff --git a/blocksuite/framework/sync/src/utils/throw-if-aborted.ts b/blocksuite/framework/sync/src/utils/throw-if-aborted.ts index 54e2c81ac9..c0a1ac98fd 100644 --- a/blocksuite/framework/sync/src/utils/throw-if-aborted.ts +++ b/blocksuite/framework/sync/src/utils/throw-if-aborted.ts @@ -1,7 +1,7 @@ // because AbortSignal.throwIfAborted is not available in abortcontroller-polyfill export function throwIfAborted(abort?: AbortSignal) { if (abort?.aborted) { - throw new Error(abort.reason); + throw abort.reason; } return true; } diff --git a/packages/common/nbstore/src/utils/throw-if-aborted.ts b/packages/common/nbstore/src/utils/throw-if-aborted.ts index 54e2c81ac9..c0a1ac98fd 100644 --- a/packages/common/nbstore/src/utils/throw-if-aborted.ts +++ b/packages/common/nbstore/src/utils/throw-if-aborted.ts @@ -1,7 +1,7 @@ // because AbortSignal.throwIfAborted is not available in abortcontroller-polyfill export function throwIfAborted(abort?: AbortSignal) { if (abort?.aborted) { - throw new Error(abort.reason); + throw abort.reason; } return true; }