swissmanu / harmonyhubjs-client

A Node.JS library which allows you to interact with your Logitech Harmony Hub.
https://github.com/swissmanu/harmonyhubjs-client
MIT License
155 stars 42 forks source link

Handle XMPP error events #26

Closed maddox closed 7 years ago

maddox commented 7 years ago

XMPP error events are not currently being handled. When errors aren't handled, they're thrown. Unfortunately for projects that use this lib, when this happens, we can't catch these thrown errors.

I've personally been struggling with this in my harmony-api project.

I know this handling is super naive, and the error should probably be returned instead, but my experience with this stuff is pretty small. I figure that this pull could at least get a conversation going.

swissmanu commented 7 years ago

thank you for your contribution @maddox until a better error handling is there, would you mind using debug() instead of console.log() instead?

maddox commented 7 years ago

Oh yeah, totally, sorry about that! Fixed.

swissmanu commented 7 years ago

awesome! thank you :)

maddox commented 7 years ago

Could you push a new version to NPM? Without this change I'm forced to use my own fork with my project. But I can't actually just have it install this project via GitHub because of #27.

So I'm still forced to link to my own custom fork even though the problem has been resolved. I'm pushing out 2.0 of harmony-api tonight, so I'd love to be on the standard package instead of a fork installed via GitHub.

Thanks!

swissmanu commented 7 years ago

aww man! totally forget to making the commit message have to right format... semantic-release expects to have a commitizen-friendly message format. having this, releases are triggered automagically.

however, 1.1.9 with your contribution is available just now.