Closed arrtchiu closed 10 years ago
Looks fine to me, only thing I would like to see is a test. However, if someone else approves this it can be merged in.
:) Thanks! Maybe we should bump the version number too?
Agreed, and thanks for the enhancement! FYI we are putting the final touches on a major rewrite for the new API released yesterday, so we'd welcome your input on that in the future too (see my fork for preview)
Noticed an exception while parsing JSON during a brief connection issue between CloudFlare and BitPay. CloudFlare in this instance responded with a HTML page which caused the JSON parser to fail.
This definitely isn't the most elegant approach (we should check response code too) but it at the very least allows API users to rescue from
BitPayError
in the event this occurs again.Also took the opportunity to DRY the code a little.