aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/ctx.ts
diff options
context:
space:
mode:
authorVeetaha <[email protected]>2020-02-16 23:47:14 +0000
committerVeetaha <[email protected]>2020-02-17 00:07:11 +0000
commitbd113623a02dc253549464667af8931e2ff378bc (patch)
treea3fabd75ef0e1b5b60381d62f761c94daf2d1299 /editors/code/src/ctx.ts
parent31ae64644864257b2375167df56c0b2e3839a9fd (diff)
vscode: minor refactorings
Diffstat (limited to 'editors/code/src/ctx.ts')
-rw-r--r--editors/code/src/ctx.ts12
1 files changed, 4 insertions, 8 deletions
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts
index 9fcf2ec38..ff6245f78 100644
--- a/editors/code/src/ctx.ts
+++ b/editors/code/src/ctx.ts
@@ -91,15 +91,11 @@ export async function sendRequestWithRetry<R>(
91 for (const delay of [2, 4, 6, 8, 10, null]) { 91 for (const delay of [2, 4, 6, 8, 10, null]) {
92 try { 92 try {
93 return await (token ? client.sendRequest(method, param, token) : client.sendRequest(method, param)); 93 return await (token ? client.sendRequest(method, param, token) : client.sendRequest(method, param));
94 } catch (e) { 94 } catch (err) {
95 if ( 95 if (delay === null || err.code !== lc.ErrorCodes.ContentModified) {
96 e.code === lc.ErrorCodes.ContentModified && 96 throw err;
97 delay !== null
98 ) {
99 await sleep(10 * (1 << delay));
100 continue;
101 } 97 }
102 throw e; 98 await sleep(10 * (1 << delay));
103 } 99 }
104 } 100 }
105 throw 'unreachable'; 101 throw 'unreachable';