Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WithContext ¶
WithContext is an error associated with a logging context string (e.g. `job="foo", instance="bar"`). It is formatted as:
fmt.Sprintf("[%s] %s", Context(), RawError())
func Errorf ¶
func Errorf(context, format string, a ...interface{}) WithContext
Errorf formats according to a format specifier and returns a new WithContext.
func Wrap ¶
func Wrap(context string, err error) WithContext
Wrap returns a WithContext wrapping err. If err is nil, it returns nil. If err is a WithContext, it is returned unchanged.
func Wrapf ¶
func Wrapf(context string, err error, format string, a ...interface{}) WithContext
Wrapf returns a WithContext that prepends a formatted message to err.Error(). If err is nil, it returns nil. If err is a WithContext, the returned WithContext will have the message prepended but the same context as err (presumed to be more specific).
Click to show internal directories.
Click to hide internal directories.