diff --git a/packages/core/src/core/UnCancelToken.test.ts b/packages/core/src/core/UnCancelToken.test.ts index 797b21c..cc13444 100644 --- a/packages/core/src/core/UnCancelToken.test.ts +++ b/packages/core/src/core/UnCancelToken.test.ts @@ -31,6 +31,7 @@ describe("core:UnCancelToken", () => { cancel("Operation has been canceled."); expect(token.reason).toEqual(expect.any(UnCanceledError)); expect(token.reason?.message).toBe("Operation has been canceled."); + expect(token.reason?.isUnCanceledError).toBe(true); }); it("returns undefined if cancellation has not been requested", () => { diff --git a/packages/core/src/core/UnCancelToken.ts b/packages/core/src/core/UnCancelToken.ts index 616253e..5de374a 100644 --- a/packages/core/src/core/UnCancelToken.ts +++ b/packages/core/src/core/UnCancelToken.ts @@ -3,6 +3,7 @@ import { UnCanceledError } from "./UnCanceledError"; export interface UnCancel { message?: string; + isUnCanceledError: true; } export interface UnCancelStatic { diff --git a/packages/core/src/core/UnCanceledError.ts b/packages/core/src/core/UnCanceledError.ts index 6b127a1..3c5eccb 100644 --- a/packages/core/src/core/UnCanceledError.ts +++ b/packages/core/src/core/UnCanceledError.ts @@ -2,7 +2,7 @@ import type { UnConfig, UnData, UnTask } from "../types"; import { UnError } from "./UnError"; class UnCanceledError extends UnError { - isUnCanceledError = true; + isUnCanceledError: true = true; constructor(message?: string, config?: UnConfig, task?: UnTask) { super(message ?? "canceled");