Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Inconsistent body.results, err at /src/robinhood.js:147 #58

Open
ghost opened this issue Sep 30, 2017 · 0 comments
Open

Inconsistent body.results, err at /src/robinhood.js:147 #58

ghost opened this issue Sep 30, 2017 · 0 comments

Comments

@ghost
Copy link

ghost commented Sep 30, 2017

Code being executed:

$ node app.js 
Robinhood web app listening on port 5010!

Expected result

The data from the requested endpoint.

Actual behaviour

(node:10455) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): [object Object]
(node:10455) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: getaddrinfo ENOTFOUND api.robinhood.com api.robinhood.com:443
/Users/alexanderpholland/robinhood-web-app/server/node_modules/robinhood/src/robinhood.js:147
if (body.results) {
^

TypeError: Cannot read property 'results' of undefined
at Request._callback (/Users/alexanderpholland/robinhood-web-app/server/node_modules/robinhood/src/robinhood.js:147:17)
at self.callback (/Users/alexanderpholland/robinhood-web-app/server/node_modules/request/request.js:186:22)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Request.onRequestError (/Users/alexanderpholland/robinhood-web-app/server/node_modules/request/request.js:878:8)
at emitOne (events.js:96:13)
at ClientRequest.emit (events.js:188:7)
at TLSSocket.socketErrorListener (_http_client.js:310:9)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)

Reproducing

Call the /accounts endpoints.

// Please provide a bit of context for the code snippet, were you authenticated?

Was authenticated and using token to request.

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

No branches or pull requests

0 participants