diff --git a/modules/ble_unsupported.go b/modules/ble_unsupported.go index 503a156a..e813262e 100644 --- a/modules/ble_unsupported.go +++ b/modules/ble_unsupported.go @@ -3,11 +3,15 @@ package modules import ( - "fmt" + "errors" "github.com/bettercap/bettercap/session" ) +var ( + notSupported = errors.New("ble.recon is not supported on this OS") +) + type BLERecon struct { session.SessionModule } @@ -31,13 +35,13 @@ func NewBLERecon(s *session.Session) *BLERecon { d.AddHandler(session.NewModuleHandler("ble.recon on", "", "Start Bluetooth Low Energy devices discovery.", func(args []string) error { - return fmt.Errorf("ble.recon is not supported on Windows") + return notSupported })) d.AddHandler(session.NewModuleHandler("ble.recon off", "", "Stop Bluetooth Low Energy devices discovery.", func(args []string) error { - return fmt.Errorf("ble.recon is not supported on Windows") + return notSupported })) return d @@ -56,13 +60,13 @@ func (d BLERecon) Author() string { } func (d *BLERecon) Configure() (err error) { - return fmt.Errorf("ble.recon is not supported on Windows and macOS") + return notSupported } func (d *BLERecon) Start() error { - return fmt.Errorf("ble.recon is not supported on Windows and macOS") + return notSupported } func (d *BLERecon) Stop() error { - return fmt.Errorf("ble.recon is not supported on Windows and macOS") + return notSupported }