Comments (7)
@roopesh Returning (error, body, response) would be non-standard behavior for a Node library so that is a non-starter. However body
is already fully contained within response
so only response
would need to be returned.
Changing the return parameters to the node-back would be a breaking change to the API and so per semver rules that cannot be considered for 2.x. I will however consider it for 3.x. Please feel free to elaborate on what you'd like to see if it is different than what I just described.
from teslajs.
@roopesh Can you elaborate on your issue a little bit further? All API's take a standard Node-style callback which returns (error, data) to the callback function. Are you asking to return the body instead of the response? And are you asking to return an error or data but not both?
from teslajs.
So when I send in an invalid token I don't get an error object back. In fact the node instance was creating because there wasn't a response in the data. The only way to know what was happening was to get the response and check the statusCode. I could see the 401.
So in my local version I return error, response, and body to interpret the call's output.
from teslajs.
Oops. The node instance was crashing.
from teslajs.
That works for me. I'll update mine to return response, too, and see if it works.
from teslajs.
That works. I'm now just getting the error, response back from the POST (I'm going to change the GET to the same thing) and I can get to the body from there.
Thank you!
from teslajs.
@roopesh You are welcome! Hope the library works for your needs.
from teslajs.
Related Issues (20)
- Unauthorized HOT 1
- Access Tokens only valid for 8 hours HOT 6
- Fix issues from recent merge
- 4.10.0 release missing on npm HOT 2
- Way to differentiate 5, 6, 7 seat Model X
- vehicleData without sleep avoidance
- Low level request API
- Login returns "credentials rejected" HOT 4
- Sample login.js return 403.. HOT 4
- Maxdefrost not working ?
- command remote_start_drive exception {"response":null,"error":"user not found","error_description":""} HOT 2
- npm ERR! 404 Not Found - GET https://registry.npmjs.org/colors/-/colors-1.4.2.tgz HOT 1
- Does it work in react-native?
- Unlatch door HOT 1
- All state APIs return 404s HOT 2
- Getting "Error: Login credentials rejected" despite being able to login to my account on Tesla.com? HOT 3
- Support for Tesla Vehicle Command protocol HOT 13
- Location information missing since upgrade vehicle software to 2023.38.x HOT 3
- Server run file HOT 5
- login.js error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teslajs.