Closed tuxitor closed 6 years ago
When doing a call to a nonexisting endpoint, this one caoncats the error code and buffer. which means I am getting the entire html page in return.
if (res.statusCode !== 200) { return callback(new Error('Bitstamp error ' + res.statusCode + ': ' + buffer)); }
Is it possible get the return as two different entities, preferably as an object with statusCode and a short descriptive text like this for the most common error codes?
{ statusCode: 404, statusText: 'Not found' }
At least separate the statusCode from the buffer.
@askmike A reminder
Sorry that it took so long for a fix :(
You can now access a meta property on the error that (if bitstamp returned valid JSON) contains that object.
meta
When doing a call to a nonexisting endpoint, this one caoncats the error code and buffer. which means I am getting the entire html page in return.
Is it possible get the return as two different entities, preferably as an object with statusCode and a short descriptive text like this for the most common error codes?
At least separate the statusCode from the buffer.