Skip to content

Commit dc606ff

Browse files
authored
try to workaround got issue with unhandledRejection (#6230)
1 parent b1be810 commit dc606ff

File tree

3 files changed

+652
-261
lines changed

3 files changed

+652
-261
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@
125125
"@graphiql/react": "patches/@graphiql__react.patch",
126126
"countup.js": "patches/countup.js.patch",
127127
"@oclif/[email protected]": "patches/@[email protected]",
128-
"@fastify/vite": "patches/@fastify__vite.patch"
128+
"@fastify/vite": "patches/@fastify__vite.patch",
129+
129130
}
130131
}
131132
}

patches/[email protected]

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/index.js b/index.js
2+
index c48660ea0f74f3d61c2ab8d57f139f7c115e91de..651b5a7d30656c8f41291b3a978b0b5f0a7ad62f 100644
3+
--- a/index.js
4+
+++ b/index.js
5+
@@ -50,7 +50,11 @@ export default class PCancelable {
6+
7+
const onCancel = handler => {
8+
if (this.#state !== promiseState.pending) {
9+
- throw new Error(`The \`onCancel\` handler was attached after the promise ${this.#state.description}.`);
10+
+ console.error(
11+
+ `The \`onCancel\` handler was attached after the promise ${this.#state.description}.`,
12+
+ );
13+
+
14+
+ return;
15+
}
16+
17+
this.#cancelHandlers.push(handler);

0 commit comments

Comments
 (0)