forked from evcc-io/evcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.go
25 lines (17 loc) · 911 Bytes
/
error.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
package api
import "errors"
// ErrNotAvailable indicates that a feature is not available
var ErrNotAvailable = errors.New("not available")
// ErrMustRetry indicates that a rate-limited operation should be retried
var ErrMustRetry = errors.New("must retry")
// ErrSponsorRequired indicates that a sponsor token is required
var ErrSponsorRequired = errors.New("sponsorship required, see https://github.com/evcc-io/evcc#sponsorship")
// ErrMissingCredentials indicates that user/password are missing
var ErrMissingCredentials = errors.New("missing credentials")
// ErrTimeout is the error returned when a timeout happened.
// Modeled after context.DeadlineError
var ErrTimeout error = errTimeoutError{}
type errTimeoutError struct{}
func (errTimeoutError) Error() string { return "timeout" }
func (errTimeoutError) Timeout() bool { return true }
func (errTimeoutError) Temporary() bool { return true }