Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): fix throw if aborted polyfill (#10321)

EYHN4f831732e192
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;
}