forked from theojulienne/go-wireless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
28 lines (22 loc) · 888 Bytes
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package wireless
import (
"errors"
"strings"
)
var (
// ErrCmdTimeout is an error that happens when the command times out
ErrCmdTimeout = errors.New("timeout while waiting for command response")
// ErrScanFailed is an error that happens when scanning for wifi networks fails
ErrScanFailed = errors.New("scan failed")
ErrSSIDNotFound = errors.New("SSID not found")
ErrAuthFailed = errors.New("auth failed")
ErrDisconnected = errors.New("disconnected")
ErrAssocRejected = errors.New("assocation rejected")
ErrNoIdentifier = errors.New("no id_str field found")
ErrInvalidEvent = errors.New("invalid event message")
)
// IsUseOfClosedNetworkConnectionError will return true if the error is about use of
// closed network connection
func IsUseOfClosedNetworkConnectionError(err error) bool {
return strings.Contains(err.Error(), "use of closed network connection")
}