dickydoouk / tp-link-tapo-connect

Unofficial Node.js library for connecting to TP-Link Tapo devices. Currently limited to the P100 & P105 smart plugs and L510E smart bulbs.
112 stars 39 forks source link

Expose the underlying error message when the TP-Link API returns an unknown error #23

Closed timrogers closed 2 years ago

timrogers commented 2 years ago

This improves the handling of unknown errors returned by TPLink, including the error message in the thrown error as well as the error code.

Just seeing a code is rather opaque and you end up having to add debugging code into the library to actually see what came back. Exposing the message avoids this.

timrogers commented 2 years ago

@dickydoouk Thanks for taking the time to build and publish this package! It's so great to see what the open source community can do ❤️ I'd love it if you'd take the time to review my proposed changes so we can make this project even better.

P.S. I'd be happy to help you to maintain this library too, if you like!