mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
Improve robustness (#13854)
This commit is contained in:
@@ -147,7 +147,7 @@ export class FileWalker {
|
||||
|
||||
// For each root folder
|
||||
flow.parallel<string, void>(rootFolders, (rootFolder: string, rootFolderDone: (err?: Error) => void) => {
|
||||
traverse.call(this, rootFolder, onResult, (err?: Error) => {
|
||||
this.call(traverse, this, rootFolder, onResult, (err?: Error) => {
|
||||
if (err) {
|
||||
if (isNodeTraversal) {
|
||||
rootFolderDone(err);
|
||||
@@ -168,6 +168,14 @@ export class FileWalker {
|
||||
});
|
||||
}
|
||||
|
||||
private call(fun: Function, that: any, ...args: any[]): void {
|
||||
try {
|
||||
fun.apply(that, args);
|
||||
} catch (e) {
|
||||
args[args.length - 1](e);
|
||||
}
|
||||
}
|
||||
|
||||
private findTraversal(rootFolder: string, onResult: (result: IRawFileMatch) => void, cb: (err?: Error) => void): void {
|
||||
const isMac = platform.isMacintosh;
|
||||
let done = (err?: Error) => {
|
||||
|
||||
Reference in New Issue
Block a user