提交 3877f2a9 编写于 作者: M Matt Bierner

Fix parsing of result message in uploadlogs

上级 f73e7bdd
......@@ -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<PostResult>((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(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册