Make sure we don't log an exception for cancelled ts requests while server is still coming online

Fixes #58781
This commit is contained in:
Matt Bierner
2018-09-17 13:59:18 -07:00
parent 17e5e90742
commit e6572ca1ea
2 changed files with 8 additions and 2 deletions

View File

@@ -157,7 +157,7 @@ class GetErrRequest {
};
client.executeAsync('geterr', args, _token.token)
.then(undefined, () => { })
.catch(() => true)
.then(() => {
if (this._done) {
return;

View File

@@ -26,7 +26,13 @@ class TypeScriptFoldingProvider implements vscode.FoldingRangeProvider {
}
const args: Proto.FileRequestArgs = { file };
const { body } = await this.client.execute('getOutliningSpans', args, token);
let body: Proto.OutliningSpan[] | undefined;
try {
body = (await this.client.execute('getOutliningSpans', args, token)).body;
} catch {
// noop
}
if (!body) {
return;
}