node_modules/binance/lib/util/BaseRestClient.js
/**
     * @private generic handler to parse request exceptions
     */
@private generic handler to parse request exceptions
@private generic handler to parse request exceptions
parseException(e, url) {
        var _a, _b;
        const { response, request, message } = e;
        if (response && response.headers) {
            this.updateApiLimitState(response.headers, url);
        }
        if (this.options.parseExceptions === false) {
            throw e;
        }
        if (!response) {
            if (!request) {
                throw message;
            }
            throw e;
        }
        throw {
            code: (_a = response.data) === null || _a === void 0 ? void 0 : _a.code,
            message: (_b = response.data) === null || _b === void 0 ? void 0 : _b.msg,
            body: response.data,
            headers: response.headers,
            requestUrl: url,
            requestBody: request.body,
            requestOptions: this.options
        };
    }
parseException ( e , url ) { var _a , _b ; const { response , request , message } = e ; if ( response && response . headers ) { this . updateApiLimitState ( response . headers , url ) ; } if ( this . options . parseExceptions === false ) { throw e ; } if ( ! response ) { if ( ! request ) { throw message ; } throw e ; } throw { code : ( _a = response . data ) === null || _a === void 0 ? void 0 : _a . code , message : ( _b = response . data ) === null || _b === void 0 ? void 0 : _b . msg , body : response . data , headers : response . headers , requestUrl : url , requestBody : request . body , requestOptions : this . options } ; }
@private generic handler to parse request exceptions
@private generic handler to parse request exceptions
// console.log('raw response: ', JSON.stringify({ //   request: request.body, //   body: response?.data, //   headers: response?.headers // }, null, 2)) // Something happened in setting up the request that triggered an Error // request made but no response received // console.log('response body: ', e.response?.data); // The request was made and the server responded with a status code // that falls out of the range of 2xx