提交 249b59ed 编写于 作者: R Rob Lourens

Fix more error handlers behind Promise.join

上级 9bea4fae
......@@ -424,7 +424,7 @@ export class SearchTreeController extends WorkbenchTreeController {
getActions: () => {
const actions: IAction[] = [];
fillInContextMenuActions(this.contextMenu, { shouldForwardArgs: true }, actions, this.contextMenuService);
return Promise.resolve(actions);
return actions;
},
getActionsContext: () => element
......
......@@ -100,12 +100,8 @@ class FileSearchEngine {
limitHit: this.isLimitHit,
stats: stats[0] || undefined // Only looking at single-folder workspace stats...
});
}, (errs: Error[]) => {
const errMsg = errs
.map(err => toErrorMessage(err))
.filter(msg => !!msg)[0];
reject(new Error(errMsg));
}, (err: Error) => {
reject(new Error(toErrorMessage(err)));
});
});
}
......
......@@ -157,13 +157,6 @@ export class SearchService extends Disposable implements ISearchService {
stats: completes[0].stats,
results: arrays.flatten(completes.map(c => c.results))
};
}, errs => {
if (!Array.isArray(errs)) {
errs = [errs];
}
errs = errs.filter(e => !!e);
return Promise.wrapError(errs[0]);
});
return new Promise((resolve, reject) => {
......@@ -244,13 +237,10 @@ export class SearchService extends Disposable implements ISearchService {
this.sendTelemetry(query, endToEndTime, complete);
});
return completes;
}, errs => {
}, err => {
const endToEndTime = e2eSW.elapsed();
this.logService.trace(`SearchService#search: ${endToEndTime}ms`);
errs = errs
.filter(e => !!e);
const searchError = deserializeSearchError(errs[0] && errs[0].message);
const searchError = deserializeSearchError(err.message);
this.sendTelemetry(query, endToEndTime, null, searchError);
throw searchError;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册