JakeBednard / node-phea

An unoffcial Phillips Hue Entertainment API library for Node.js
MIT License
32 stars 8 forks source link

Avoiding uncatchable exceptions and allowing to handle disconnections #16

Closed Durss closed 2 years ago

Durss commented 3 years ago

Cleaning up the asynchronous exceptions that crashes the process with no easy way to avoid this. Also the start() method now returns the socket reference so we can capture the close event in order to manually reconnect if necessary.

The README.md has been updated to reflect those changes.

These updates allows to handle the connection errors if another connection is already active as well as handling a connection loss. This connection loss can happen if closing it from within the Hue app for example.