Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error handling #2

Open
geovie opened this issue Sep 28, 2018 · 0 comments
Open

Improve error handling #2

geovie opened this issue Sep 28, 2018 · 0 comments

Comments

@geovie
Copy link
Contributor

geovie commented Sep 28, 2018

Currently we only log error in the noble-winrt package as noble has a rather bad error handling story (noble/noble#830). The problem is that it only emits a warning if e.g. a peripheral is not found and there is no way for bindings to return an error.

A proper solution would be to add a error argument in the bindings interface and the noble interface to let bindings error bubble up to the user.

Noble.prototype.onDisconnect = function(peripheralUuid, error) {
  var peripheral = this._peripherals[peripheralUuid];
  if (peripheral) {
    peripheral.emit('disconnect', error);
  } else {
    this.emit('warning', 'unknown peripheral ' + peripheralUuid + ' disconnected!');
  }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant