supress cryptic error message

This commit is contained in:
David Lechner
2020-04-17 00:55:29 -05:00
parent 2772e76a62
commit 232a8f5db5
+8 -1
View File
@@ -87,7 +87,14 @@ export function connect(): BLEThunkAction {
});
} catch (err) {
// this can happen if the use cancels the dialog
console.log(err);
if (
err instanceof DOMException &&
err.code === DOMException.NOT_FOUND_ERR
) {
console.debug('User cancelled connect');
} else {
console.error(err);
}
dispatch(endDisconnect());
return;
}