check for error before you do anything else
This commit is contained in:
parent
981836513a
commit
b2e3f03baa
|
|
@ -79,6 +79,13 @@ function analyzeUrl(args, asyncDoneCallback) {
|
|||
|
||||
wpt.runTest(url, wptOptions, function(err, data) {
|
||||
|
||||
if (err) {
|
||||
log.log('error', "WebPageTest couldn't fetch info for url " + url + '(' +
|
||||
JSON.stringify(err) + ')');
|
||||
asyncDoneCallback(undefined, err);
|
||||
return;
|
||||
}
|
||||
|
||||
var id = data.response.data.testId;
|
||||
|
||||
/*
|
||||
|
|
@ -105,13 +112,6 @@ function analyzeUrl(args, asyncDoneCallback) {
|
|||
*/
|
||||
|
||||
|
||||
// TODO check for err
|
||||
if (err) {
|
||||
log.log('error', "WebPageTest couldn't fetch info for url " + url + '(' +
|
||||
JSON.stringify(err) + ')');
|
||||
asyncDoneCallback(undefined, err);
|
||||
return;
|
||||
}
|
||||
var jsonPath = path.join(config.run.absResultDir, config.dataDir,
|
||||
'webpagetest',
|
||||
util.getUrlHash(url) + '-webpagetest.json');
|
||||
|
|
|
|||
Loading…
Reference in New Issue