fixing btc

This commit is contained in:
martind2000 2017-06-12 13:47:24 +01:00
parent bcc7a3d87e
commit 287ebbffa0

View File

@ -23,11 +23,16 @@ exports.doBTC = function (req, res) {
}); });
response.on('end', function () { response.on('end', function () {
console.log('>> data', data); console.log('>> data', data);
let cData = {};
try { try {
callback(JSON.parse(data), r); cData = JSON.parse(data);
} catch (e) { }
catch (e) {
console.error(e); console.error(e);
} }
finally{
callback(cData, r);
}
}); });
response.on('error', function (e) { response.on('error', function (e) {