Fix flaky tests (#3724)
* adds continuation to silence rejected promises * Wrap json parsing
This commit is contained in:
@@ -32,7 +32,11 @@ function graphRequest(path) {
|
||||
throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'qq auth is invalid for this user.');
|
||||
}
|
||||
data = data.substring(starPos + 1,endPos - 1);
|
||||
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