forked from GlenDC/go-external-ip
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patherror.go
More file actions
22 lines (18 loc) · 726 Bytes
/
error.go
File metadata and controls
22 lines (18 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package externalip
import "errors"
// InvalidIPError is returned when an value returned is invalid.
// This error should be returned by the source itself.
type InvalidIPError string
// Error implements error.Error
func (err InvalidIPError) Error() string {
return "Invalid IP: " + string(err)
}
var (
// ErrNoIP is returned by the Consensus when no vote was casted successfully
ErrNoIP = errors.New("no IP could be found")
// ErrInsufficientWeight is returned when a voter's weight is invalid
ErrInsufficientWeight = errors.New("a voter's weight has to be at least 1")
// ErrNoSource is returned when a voter is added,
// which doesn't have a source specified
ErrNoSource = errors.New("no voter's source given")
)