Skip to content

Commit

Permalink
Handle API key limits
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinBressan authored and PopDaph committed May 23, 2014
1 parent f15de7c commit c60a31f
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions lib/pollers/webpagetest/webPageTestPoller.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,21 @@ WebPageTestPoller.prototype.poll = function() {
* @api private
*/
WebPageTestPoller.prototype.onTestStartedCallback = function(err,data){
this.testId = data.data.testId;
if(data.data.userUrl){
this.userUrl = data.data.userUrl;
if(err){
console.log(err);
this.timer.stop();
}else{
if(data.statusCode && data.statusCode == 200){
this.testId = data.data.testId;
if(data.data.userUrl){
this.userUrl = data.data.userUrl;
}
this.debug('WebPageTest test started [testId='+this.testId+']');
this.checkTestStatus();
}else{
return this.onErrorCallback({ name: "Test not started", message: data.statusText});
}
}
this.debug('WebPageTest test started [testId='+this.testId+']');
this.checkTestStatus();
};

/**
Expand Down

0 comments on commit c60a31f

Please sign in to comment.