diff --git a/utils/src/errors.ts b/utils/src/errors.ts index 0cf38be53e..53b54053d3 100644 --- a/utils/src/errors.ts +++ b/utils/src/errors.ts @@ -16,7 +16,10 @@ export class UserCancelledError extends Error { } export function isUserCancelledError(error: unknown): error is UserCancelledError { - return !!error && typeof error === 'object' && (error as UserCancelledError)._isUserCancelledError; + return !!error && + typeof error === 'object' && + '_isUserCancelledError' in error && + error._isUserCancelledError === true; } export class GoBackError extends Error {