Closed bfailing closed 4 years ago
Hi @bfailing, it is by design that only data is returned. Why would you need more than this? If there is an error you will get the full HTTP response (with status code, etc.).
To test this (i.e. hit a rate limit), I need to disable the rate limiting in your code. How do I do that?
The rate limiting is implemented here: https://github.com/bennyn/coinbase-pro-node/blob/v1.4.1/src/client/RESTClient.ts#L42-L48
@bfailing here is an example how you can catch errors with additional information (you will get everything which AxiosError
provides):
import {AxiosError} from 'axios';
import {CoinbasePro} from 'coinbase-pro-node';
// [...]
client.rest.product.getCandles('DOES-BOT-EXIST').catch((error: AxiosError) => {
console.error(`Request failed when querying "${error.config.url}": ${error.message}`);
});
I hope this answers your question. Please leave me a star if it does. ⭐
The following seems to only return the body from the response:
How do you get the complete response including, e.g., the status code?