Fix mqtt logging and return values (#739)
This commit is contained in:
parent
5018ce4b79
commit
d21d15e9d7
4 changed files with 33 additions and 17 deletions
10
api/error.go
10
api/error.go
|
|
@ -4,3 +4,13 @@ import "errors"
|
|||
|
||||
// ErrNotAvailable indicates that a feature is not available
|
||||
var ErrNotAvailable = errors.New("not available")
|
||||
|
||||
// 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 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue