TuyaAPI / cloud

🌨 🎁 A NodeJS wrapper for Tuya's cloud API. Documentation: https://tuyaapi.github.io/cloud/.
MIT License
32 stars 15 forks source link

Throw a real Error from request() to preserve call stack info #1

Closed ariofrio closed 5 years ago

codetheweb commented 5 years ago

👍 thanks, wasn't sure what the best way to go about this was when writing it.

codetheweb commented 5 years ago

Published @0.3.2.

ariofrio commented 5 years ago

Jumped the gun on this. Needs call to super() at the beginning of the constructor. Pull request incoming.

codetheweb commented 5 years ago

Yep, already fixed it. 😉

ariofrio commented 5 years ago

Ah, good. Thanks!

ariofrio commented 5 years ago

Might want to do super(options.message) instead so the Error message is set.

Update: Never mind, I think that's what this.message does. Testing...

Update 2: Right, it works well as-is.