*/
export function raceCancellationError<T>(promise: Promise<T>, token: CancellationToken): Promise<T> {
const ref = token.onCancellationRequested(() => {
ref.dispose();
reject(new CancellationError());
promise.then(resolve, reject).finally(() => ref.dispose());
});
}
export function rejectIfNotCanceled(err: unknown): undefined {