Add error handling to connect call

This commit is contained in:
Elara 2021-08-21 20:25:09 -07:00
parent 7f19dfb354
commit 91fbe718e5

View File

@ -151,7 +151,10 @@ func connectByName() (*Device, error) {
return nil, ErrNoDevices return nil, ErrNoDevices
} }
// Connect to device // Connect to device
out.device.Connect() err = out.device.Connect()
if err != nil {
return nil, err
}
// Resolve characteristics // Resolve characteristics
err = out.resolveChars() err = out.resolveChars()
if err != nil { if err != nil {