Skip to content

Commit

Permalink
Make sure we don't log an exception for cancelled ts requests while s…
Browse files Browse the repository at this point in the history
…erver is still coming online

Fixes #58781
  • Loading branch information
mjbvz committed Sep 17, 2018
1 parent 17e5e90 commit e6572ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class GetErrRequest {
};

client.executeAsync('geterr', args, _token.token)
.then(undefined, () => { })
.catch(() => true)
.then(() => {
if (this._done) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e6572ca

Please sign in to comment.