Fix flaky tests (#3724)
* adds continuation to silence rejected promises * Wrap json parsing
This commit is contained in:
@@ -36,7 +36,11 @@ function request(path, access_token) {
|
||||
data += chunk;
|
||||
});
|
||||
res.on('end', function() {
|
||||
data = JSON.parse(data);
|
||||
try {
|
||||
data = JSON.parse(data);
|
||||
} catch(e) {
|
||||
return reject(e);
|
||||
}
|
||||
resolve(data);
|
||||
});
|
||||
}).on('error', function() {
|
||||
|
||||
Reference in New Issue
Block a user