Skip to content

Commit 7c37cf6

Browse files
authored
Merge pull request #196 from rikkuness/fix-node-ble-callbacks
Correction to error handling on serial_node_ble
2 parents 98404ba + e48bf09 commit 7c37cf6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

core/serial_node_ble.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,12 @@
122122
}
123123

124124
getAdapter().then((adapter) =>
125-
scanDevices(adapter)).catch(() =>
126-
callback([], true)
127-
).then((devices) =>
125+
scanDevices(adapter)).then((devices) =>
128126
callback(devices, false)
129-
);
127+
).catch((err) => {
128+
console.error("serial_node_ble", "error on scanDevices", err)
129+
callback([], true)
130+
})
130131
};
131132

132133
var closeSerial = function () {

0 commit comments

Comments
 (0)