codetheweb / tuyapi

🌧 An easy-to-use API for devices that use Tuya's cloud services. Documentation: https://codetheweb.github.io/tuyapi.
MIT License
2.06k stars 339 forks source link

Another possible throw vs reject? #45

Closed tomporter518 closed 6 years ago

tomporter518 commented 6 years ago

I am wondering if this might be another scenario were a reject would be useful. My cron'd script failed this morning due to this throw.

https://github.com/codetheweb/tuyapi/blob/f07a2a5ab0bfa5d1ebfdaa7270d8cfa407c2de7f/index.js#L255

codetheweb commented 6 years ago

Once again, you're right.

I did some research and looked at other instances of throw and reject; everything else seems to be fine.

Fixed.

tomporter518 commented 6 years ago

Thanks for the quick turn around. As you can probably tell, I use this package quite a bit. I have cron'd entries on a raspberry pi to randomly (within a specified window) control some switches.

codetheweb commented 6 years ago

👍