@0xproject/connect
Advanced tools
Comparing version 0.6.0 to 0.6.1
# CHANGELOG | ||
## v0.6.1 - _February 16, 2018_ | ||
* Fix JSON parse empty response (#407) | ||
## v0.6.0 - _February 16, 2018_ | ||
@@ -4,0 +8,0 @@ |
@@ -238,3 +238,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var params, payload, query, url, headers, response, json, errorString; | ||
var params, payload, query, url, headers, response, text, errorString, result; | ||
return __generator(this, function (_a) { | ||
@@ -257,10 +257,11 @@ switch (_a.label) { | ||
response = _a.sent(); | ||
return [4 /*yield*/, response.json()]; | ||
return [4 /*yield*/, response.text()]; | ||
case 2: | ||
json = _a.sent(); | ||
text = _a.sent(); | ||
if (!response.ok) { | ||
errorString = response.status + " - " + response.statusText + "\n" + requestType + " " + url + "\n" + JSON.stringify(json); | ||
errorString = response.status + " - " + response.statusText + "\n" + requestType + " " + url + "\n" + text; | ||
throw Error(errorString); | ||
} | ||
return [2 /*return*/, json]; | ||
result = !_.isEmpty(text) ? JSON.parse(text) : undefined; | ||
return [2 /*return*/, result]; | ||
} | ||
@@ -267,0 +268,0 @@ }); |
@@ -16,3 +16,3 @@ import { OrderbookChannel, OrderbookChannelHandler, OrderbookChannelSubscriptionOpts, WebSocketOrderbookChannelConfig } from './types'; | ||
* @param url The relayer API base WS url you would like to interact with | ||
* @param url The configuration object. Look up the type for the description. | ||
* @param config The configuration object. Look up the type for the description. | ||
* @return An instance of WebSocketOrderbookChannel | ||
@@ -19,0 +19,0 @@ */ |
@@ -20,3 +20,3 @@ "use strict"; | ||
* @param url The relayer API base WS url you would like to interact with | ||
* @param url The configuration object. Look up the type for the description. | ||
* @param config The configuration object. Look up the type for the description. | ||
* @return An instance of WebSocketOrderbookChannel | ||
@@ -23,0 +23,0 @@ */ |
{ | ||
"name": "@0xproject/connect", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "A javascript library for interacting with the standard relayer api", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
118201
1778