phillipj / node-plex-control

Controlling Plex clients through the Plex Media Server HTTP API
MIT License
31 stars 6 forks source link

Report error when not finding client #3

Open phillipj opened 9 years ago

phillipj commented 9 years ago

When providing the client name or IP of client when using the PlexControl constructor and a matching client is not found on the Plex server, there is no way of knowing atm. As most actions on a PlexControl instance requires the client to have been resolved properly, swallowing resolve errors are very confusing.

Either emit a resolve-error-event or remove the second argument from the PlexControl constructor which forces everyone to use the .setClient() method after object instantiation which returns a promise already.