mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-29 13:49:28 +08:00

* Switch CoAP lib Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Revert removed adapter code Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * WIP CoAP refactor Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add auth key Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix observers map Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix reading message body Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix subtopic parsing Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix error handling Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Fix multi-protocol communication Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Separate client from observer Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Remove unused config Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Remove TCP option Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Inline error check Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Add logging client errors Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Replace RWMutex since we're not using RLock Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Inline error handling Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com> * Inline error handling Signed-off-by: dusanb94 <dusan.borovcanin@mainflux.com>
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
// Copyright 2018 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package xerrors
|
|
|
|
// A Formatter formats error messages.
|
|
type Formatter interface {
|
|
error
|
|
|
|
// FormatError prints the receiver's first error and returns the next error in
|
|
// the error chain, if any.
|
|
FormatError(p Printer) (next error)
|
|
}
|
|
|
|
// A Printer formats error messages.
|
|
//
|
|
// The most common implementation of Printer is the one provided by package fmt
|
|
// during Printf (as of Go 1.13). Localization packages such as golang.org/x/text/message
|
|
// typically provide their own implementations.
|
|
type Printer interface {
|
|
// Print appends args to the message output.
|
|
Print(args ...interface{})
|
|
|
|
// Printf writes a formatted string.
|
|
Printf(format string, args ...interface{})
|
|
|
|
// Detail reports whether error detail is requested.
|
|
// After the first call to Detail, all text written to the Printer
|
|
// is formatted as additional detail, or ignored when
|
|
// detail has not been requested.
|
|
// If Detail returns false, the caller can avoid printing the detail at all.
|
|
Detail() bool
|
|
}
|