Fix mqtt logging and return values (#739)

This commit is contained in:
andig 2021-03-09 14:58:43 +01:00 • committed by GitHub
parent 5018ce4b79
commit d21d15e9d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 17 deletions

View file

@ -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 }