I originally posted on another tread, but the more I look at this issue, the more I think it's unique, so I'll open a new ticket, and try to edit my comments on the other thread.
So the API returns a "NotFound" - which does appear in the JSON. The GDAX console log shows:
My current theory, gdax.js isn't handling "NotFound" correctly. I think the matching code is here:
/*** Get information about an order from GDAX by it's ID*/const get_order_by_id = exports.get_order_by_id = ( order_id ) => {return new Promise( (resolve, reject) => {gdax_private.getOrder( order_id, (error, response, data) => {if( error ) {reject( error )return}resolve( data )} )})}
gdax-node API says:
If the order is canceled the response may have status code 404 if the order had no matches.
I originally posted on another tread, but the more I look at this issue, the more I think it's unique, so I'll open a new ticket, and try to edit my comments on the other thread.
So the API returns a "NotFound" - which does appear in the JSON. The GDAX console log shows:
However, when I try to echo out the contents of data.message to the log, it comes back empty.
let data
try {
data = await gdax.get_order_by_id( order_id )
} catch( e ) {
ui.logger('gdax_log', JSON.stringify(e))
// TODO: analyze failure modes
}
//my new lines
ui.logger('sys_log',
Trade ${trade.trade_id} Parsing)
ui.logger('sys_log',
Message ${data.message})
My current theory, gdax.js isn't handling "NotFound" correctly. I think the matching code is here:
/**
* Get information about an order from GDAX by it's ID
*/
const get_order_by_id = exports.get_order_by_id = ( order_id ) => {
return new Promise( (resolve, reject) => {
gdax_private.getOrder( order_id, (error, response, data) => {
if( error ) {
reject( error )
return
}
resolve( data )
} )
})
}
gdax-node API says: