mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 22:47:17 +00:00
17 lines
598 B
Diff
17 lines
598 B
Diff
diff --git a/index.js b/index.js
|
|
index c48660ea0f74f3d61c2ab8d57f139f7c115e91de..651b5a7d30656c8f41291b3a978b0b5f0a7ad62f 100644
|
|
--- a/index.js
|
|
+++ b/index.js
|
|
@@ -50,7 +50,11 @@ export default class PCancelable {
|
|
|
|
const onCancel = handler => {
|
|
if (this.#state !== promiseState.pending) {
|
|
- throw new Error(`The \`onCancel\` handler was attached after the promise ${this.#state.description}.`);
|
|
+ console.error(
|
|
+ `The \`onCancel\` handler was attached after the promise ${this.#state.description}.`,
|
|
+ );
|
|
+
|
|
+ return;
|
|
}
|
|
|
|
this.#cancelHandlers.push(handler);
|