From 232a8f5db5eb8f450369988f6c9bf0b16a4c96cf Mon Sep 17 00:00:00 2001 From: David Lechner Date: Fri, 17 Apr 2020 00:55:29 -0500 Subject: [PATCH] supress cryptic error message --- src/actions/ble.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/actions/ble.ts b/src/actions/ble.ts index 21575b24..c60e3819 100644 --- a/src/actions/ble.ts +++ b/src/actions/ble.ts @@ -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; }