From 56f98b17334440272b5dd70c5bc38a990d75c09f Mon Sep 17 00:00:00 2001 From: Ingo Fischer Date: Thu, 31 Oct 2024 10:15:45 +0100 Subject: [PATCH] adjust errors --- src/transport/ble/ble-discovery.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transport/ble/ble-discovery.ts b/src/transport/ble/ble-discovery.ts index 454354b..50fd207 100644 --- a/src/transport/ble/ble-discovery.ts +++ b/src/transport/ble/ble-discovery.ts @@ -16,7 +16,7 @@ try { noble = (noble as any)({ extended: false }); } } catch (error) { - console.error('Cannot start noble. Make sure it is installed and BLE device is connected.'); + // Ignore } const debug = Debug('hap-controller:gatt-client'); @@ -173,7 +173,7 @@ export default class BLEDiscovery extends EventEmitter { */ start(allowDuplicates = false): void { if (!noble) { - throw new Error('BLE not enabled'); + throw new Error('BLE could not be enabled or no device found'); } this.scanEnabled = true; this.allowDuplicates = allowDuplicates; @@ -215,7 +215,7 @@ export default class BLEDiscovery extends EventEmitter { */ stop(): void { if (!noble) { - throw new Error('BLE not enabled'); + throw new Error('BLE could not be enabled or no device found'); } this.scanEnabled = false; noble.stopScanning();