Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnhandledPromiseRejectionWarning: Unhandled promise rejection #35

Closed
helxsz opened this issue Mar 19, 2018 · 7 comments
Closed

UnhandledPromiseRejectionWarning: Unhandled promise rejection #35

helxsz opened this issue Mar 19, 2018 · 7 comments

Comments

@helxsz
Copy link

helxsz commented Mar 19, 2018

blinktrade.connect().then(function() {
	return blinktrade.login({ username: config.key, password: config.password });
}).then(function(logged) {
	console.log("Connected BlinkTradeWS")
})

My node is v8.9.4 and npm 5.6.0, and I am using the latest version of BlinkTrade, when I was running the code, i got the error as shown below.

(node:9502) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): undefined
(node:9502) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@hadnet
Copy link

hadnet commented Mar 23, 2018

Same here, but it happened once, now when I try to connect again I got this:

/Users/inc/Desktop/Foxbit/node_modules/blinktrade/lib/wsTransport.js:163
throw new Error('Error: ' + data.Detail + ' ' + data.Description);
^

Error: Error: Invalid message Invalid message
at BlinkTradeWS.onMessage (/Users/inc/Desktop/Foxbit/node_modules/blinktrade/lib/wsTransport.js:163:15)
at WebSocket.onMessage (/Users/inc/Desktop/Foxbit/node_modules/ws/lib/EventTarget.js:99:16)
at WebSocket.emit (events.js:160:13)
at Receiver._receiver.onmessage (/Users/inc/Desktop/Foxbit/node_modules/ws/lib/WebSocket.js:141:47)
at Receiver.dataMessage (/Users/inc/Desktop/Foxbit/node_modules/ws/lib/Receiver.js:389:14)
at Receiver.getData (/Users/inc/Desktop/Foxbit/node_modules/ws/lib/Receiver.js:330:12)
at Receiver.startLoop (/Users/inc/Desktop/Foxbit/node_modules/ws/lib/Receiver.js:165:16)
at Receiver.add (/Users/inc/Desktop/Foxbit/node_modules/ws/lib/Receiver.js:139:10)
at TLSSocket._ultron.on (/Users/inc/Desktop/Foxbit/node_modules/ws/lib/WebSocket.js:138:22)
at TLSSocket.emit (events.js:160:13)

@cesardeazevedo
Copy link
Contributor

@helxsz We were under maintenance this week, it was expected since our servers were off.

@hadnet Does it still happen? i can't reproduce it with this code

const { BlinkTradeWS } = require('blinktrade')

const blinktrade = new BlinkTradeWS({
  brokerId: 4,
  prod: true,
})

blinktrade.connect().then(() => {
  console.log('connected')
})

@hadnet
Copy link

hadnet commented Mar 24, 2018

@cesardeazevedo it does. But it happens when I try to send a buy/sell order.

@cesardeazevedo
Copy link
Contributor

@hadnet i gotcha, i've fixed and release at 0.0.20.

Let me know if you guys have any other issue.

@hadnet
Copy link

hadnet commented Mar 26, 2018

@cesardeazevedo same as the error above, just this line changed: BlinkTradeWS.onMessage (/Users/inc/Desktop/Foxbit/node_modules/blinktrade/lib/wsTransport.js:164:15) [in error above was 163:15]. It seems something with cancel or update.

@cesardeazevedo
Copy link
Contributor

@hadnet I can't help you without a minimum information and way that i could reproduce it, what exactly you are trying to do? which part the exception occur? which function are you calling? can you post a small code that i could take a look?

@hadnet
Copy link

hadnet commented Mar 28, 2018

@cesardeazevedo Now it's suddenly working ok. Thanks anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@helxsz @cesardeazevedo @hadnet and others