diff --git a/src/vs/code/electron-main/logUploader.ts b/src/vs/code/electron-main/logUploader.ts index f4a034627d327..795321e8600ec 100644 --- a/src/vs/code/electron-main/logUploader.ts +++ b/src/vs/code/electron-main/logUploader.ts @@ -94,12 +94,22 @@ async function postLogs( throw e; } - try { - return JSON.parse(result.stream.toString()); - } catch (e) { - console.log(localize('parseError', 'Error parsing response')); - throw e; - } + return new TPromise((res, reject) => { + const parts: Buffer[] = []; + result.stream.on('data', data => { + parts.push(data); + }); + + result.stream.on('end', () => { + try { + const result = Buffer.concat(parts).toString('utf-8'); + res(JSON.parse(result)); + } catch (e) { + console.log(localize('parseError', 'Error parsing response')); + reject(e); + } + }); + }); } function zipLogs(