Skip to content

Commit aaf4560

Browse files
committed
async: ignoreErorrs
1 parent 2a8f7c5 commit aaf4560

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/vs/base/common/async.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ export function always<T>(promise: Thenable<T>, callback: () => void): Promise<T
346346
return Promise.resolve(promise);
347347
}
348348

349+
export function ignoreErrors<T>(promise: Thenable<T>): Thenable<T | undefined> {
350+
return promise.then(undefined, _ => undefined);
351+
}
352+
349353
/**
350354
* Runs the provided list of promise factories in sequential order. The returned
351355
* promise will complete to an array of results from each promise.

0 commit comments

Comments
 (0)