cryptocompare
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -0,1 +1,6 @@ | ||
0.5.0 / 2018-03-23 | ||
------------------ | ||
- changed: Handles HTTP status errors; throws on non-2xx error codes [#20](https://github.com/ExodusMovement/cryptocompare/pull/20) | ||
0.4.0 / 2018-01-09 | ||
@@ -2,0 +7,0 @@ ------------------ |
@@ -8,3 +8,8 @@ 'use strict' | ||
return fetch(url) | ||
.then(res => res.json()) | ||
.then(res => { | ||
if (!res.ok) { | ||
throw new Error(`${res.status} ${res.statusText}`) | ||
} | ||
return res.json() | ||
}) | ||
.then(body => { | ||
@@ -11,0 +16,0 @@ if (body.Response === 'Error') throw body.Message |
{ | ||
"name": "cryptocompare", | ||
"description": "CryptoCompare JavaScript API", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"author": "JP Richardson <jprichardson@gmail.com>", | ||
@@ -6,0 +6,0 @@ "bugs": { |
36981
478