Comparing version 1.3.0 to 1.3.1
# Changelog | ||
## 1.3.1 | ||
- Fix error handling for callbacks when response is empty, introduced by clock drift changes | ||
## 1.3.0 | ||
@@ -4,0 +7,0 @@ - Add the ability to have the library handle system clock drift |
@@ -73,3 +73,5 @@ const request = require('request'); | ||
} | ||
if (err || response.statusCode < 200 || response.statusCode > 299) { | ||
if (err) { | ||
callback(err, payload); | ||
} else if (response.statusCode < 200 || response.statusCode > 299) { | ||
/* | ||
@@ -89,3 +91,3 @@ * If we get a response that the timestamp is ahead of the server, | ||
} else { | ||
callback(err || new Error(`Response code ${response.statusCode}`), payload); | ||
callback(new Error(`Response code ${response.statusCode}`), payload); | ||
} | ||
@@ -127,3 +129,4 @@ } else { | ||
query.timestamp = this._getTime() + this._drift; | ||
return this._makeRequest(query, callback, route, security, method, ++attempt); | ||
return this._makeRequest(query, callback, route, security, | ||
method, ++attempt); | ||
}) | ||
@@ -130,0 +133,0 @@ .then(retryPayload => { |
{ | ||
"name": "binance", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "node.js wrapper for the Binance REST and WebSocket APIs", | ||
@@ -5,0 +5,0 @@ "main": "./lib/binance.js", |
262650
1238