Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

Please add option to override the onError handler #27

Open
derwaldgeist opened this issue Feb 22, 2018 · 0 comments
Open

Please add option to override the onError handler #27

derwaldgeist opened this issue Feb 22, 2018 · 0 comments

Comments

@derwaldgeist
Copy link

derwaldgeist commented Feb 22, 2018

We are building an application that supports many different gesture input devices. As the user does not necessarily have a Myo band, connecting to Myo Connect may fail.

In this case, the library throws an error which is not easy to catch, since it is thrown async. In my case, this caused the EventEmitter of ws to fail, and it was quite hard to track down the source of this problem.

For the time being, I'm working around this by manually overwriting Myo.onError, but it would be better if there was a way to explicitly call Myo.on('error', fn).

PS: The current behaviour of throwing in case of an error is not a good idea. It's not possible to catch this in a regular try catch due to its async behaviour. It would be better if just an error messages would be printed on the console.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant