DeviaVir / zenbot

Zenbot is a command-line cryptocurrency trading bot using Node.js and MongoDB.
MIT License
8.23k stars 2.04k forks source link

I got error err.match is not a function in bitfinex/exchange.js #257

Closed nao0811ta closed 7 years ago

nao0811ta commented 7 years ago

/home/ec2-user/workspace/zen4 -bit-2/extensions/exchanges/bitfinex/exchange.js:148 if (err && err.match(/Error: Invalid order: not enough exchange balance$/)) { ^

TypeError: err.match is not a function at /home/ec2-user/workspace/zen4-bit-2/extensions/exchanges/bitfinex/exchange.js:148:24 at Request.request [as _callback] (/home/ec2-user/workspace/zen4-bit-2/node_modules/bitfinex-api-node/rest.js:61:14) at Request.self.callback (/home/ec2-user/workspace/zen4-bit-2/node_modules/request/request.js:188:22) at emitTwo (events.js:106:13) at Request.emit (events.js:194:7) at Request. (/home/ec2-user/workspace/zen4-bit-2/node_modules/request/request.js:1171:10) at emitOne (events.js:96:13) at Request.emit (events.js:191:7) at IncomingMessage. (/home/ec2-user/workspace/zen4-bit-2/node_modules/request/request.js:1091:12) at Object.onceWrapper (events.js:293:19) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:188:7) at endReadableNT (_stream_readable.js:975:12) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9)

DeviaVir commented 7 years ago

What version of nodejs are you running? We advise at least 6.x

nao0811ta commented 7 years ago

v7.10.0

DeviaVir commented 7 years ago

@nedievas any chance you can take a look into this?

nao0811ta commented 7 years ago

maybe It think that have to fix to if (err && err.match && err.match(/Error: Invalid order: not enough exchange balance$/)) { or if (err && String(err).match(/Error: Invalid order: not enough exchange balance$/)) {

nedievas commented 7 years ago

Hi, I will. I was at the coast this weekend and see that my bot exited on this error.

nedievas commented 7 years ago

WTF. I had working bitfinex extension, and now it's dead... Will revise and update.