Skip to content
This repository was archived by the owner on May 18, 2020. It is now read-only.

Commit adfa8ad

Browse files
committed
API-124: Added timeout callback
1 parent 2398a93 commit adfa8ad

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sendinblue-api.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ SendinblueAPI.prototype.call = function(resource, method, input, cb) {
2222
}
2323

2424
restler.request(called_url, {method: method, timeout: this.timeout, data: input, headers: {'api-key': this.api_key, 'content-type': content_type}})
25+
.on('timeout', function(ms){
26+
cb(null, 'Request timed out within '+ms+' MS');
27+
})
2528
.on('complete', function(response) {
2629
var responseObj = JSON.parse(response);
2730

0 commit comments

Comments
 (0)