Skip to content

Commit

Permalink
fix: catch error on this._bindings.init()
Browse files Browse the repository at this point in the history
  • Loading branch information
bwp91 authored and rzr committed Jul 28, 2023
1 parent 93fd3c8 commit 8be1e4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/noble.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ function Noble (bindings) {
this.initialized = true;

process.nextTick(() => {
this._bindings.init();
try {
this._bindings.init();
} catch (error) {
this.emit('warning', 'Initialization of USB device failed: ' + error.message);
}
});
}
});
Expand Down

0 comments on commit 8be1e4e

Please sign in to comment.