Skip to content

Commit 3136337

Browse files
ptx2rzr
authored andcommitted
Fix insufficient permission/capability check.
Check the error code instead of the error message as the message is not guaranteed to be stable.
1 parent e5daab4 commit 3136337

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/hci-socket/hci.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ Hci.prototype.onSocketData = function(data) {
622622
Hci.prototype.onSocketError = function(error) {
623623
debug('onSocketError: ' + error.message);
624624

625-
if (error.message === 'Operation not permitted') {
625+
if (error.code === 'EPERM') {
626626
this.emit('stateChange', 'unauthorized');
627627
} else if (error.message === 'Network is down') {
628628
// no-op

0 commit comments

Comments
 (0)