Skip to content

Commit

Permalink
adjust errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed Oct 31, 2024
1 parent 2513c5d commit 56f98b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/transport/ble/ble-discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 56f98b1

Please sign in to comment.