Closed adrianbarwicki closed 5 years ago
The error handling code in BITBOX code should be updated to detect http status codes in the 400 or 500 range and throw an error. Test cases need to be added to the integration tests as well.
The source of this bug is not in BITBOX, but in rest.bitcoin.com, and should be fixed once this rest PR is merged.
This PR for rest will fix this issue with BITBOX: https://github.com/Bitcoin-com/rest.bitcoin.com/pull/357
Issue is fixed. And an integration test was created to verify. The test will also detect it if it should ever be a problem again.
I'd expect that if an error happens, it is thrown so it can be caught in the catch block. It took us some time at Honest.Cash to figure out that the Transaction.details() returns errors as a successful data.
Example
This code requests details of 50 transactions:
The details method returns successfully but the returned data is:
{ error: 'Array too large. Max 20 txids' }
Statically we would expect an array or an thrown error.