You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I disabled my WiFi to test the behaviour of my tiny script, and I got this:
/Users/ec/Dropbox/Code/generate-tesla-token/node_modules/teslajs/TeslaJS.js:320
callback(error, { error: error, response: response, body: body, authToken: loginResult.access_token, refreshToken: loginResult.refresh_token });
^
TypeError: Cannot read property 'access_token' of undefined
at Request._callback (/Users/ec/Dropbox/Code/generate-tesla-token/node_modules/teslajs/TeslaJS.js:320:95)
at self.callback (/Users/ec/Dropbox/Code/generate-tesla-token/node_modules/request/request.js:188:22)
at emitOne (events.js:115:13)
at Request.emit (events.js:210:7)
at Request.onRequestError (/Users/ec/Dropbox/Code/generate-tesla-token/node_modules/request/request.js:884:8)
at emitOne (events.js:115:13)
at ClientRequest.emit (events.js:210:7)
at TLSSocket.socketErrorListener (_http_client.js:400:9)
at emitOne (events.js:115:13)
at TLSSocket.emit (events.js:210:7)
The text was updated successfully, but these errors were encountered:
Thank you. Yes, the library does not currently test for network connectivity as that is pre-requisite to the libraries function. Is your hope mainly that the library would handle that scenario more gracefully?
Yep! Shouldn't be trying to dereference-undefined when the network is down, basically; throwing a more sensate error is, obviously, about all that is possible. ^_^
Circling back to review this one. There is no great way to test for network connectivity in Node. Common solution is a DNS resolve request which is noisy on the network. And every single library call requires a working connection to the network. I can look at better error handling if/when an exception occurs.
I disabled my WiFi to test the behaviour of my tiny script, and I got this:
The text was updated successfully, but these errors were encountered: