Documentation
¶
Index ¶
- func ContextDone(err error) bool
- func MaybeWrapWithCorrelationId(err error, correlationId string) error
- func NewUserError(msg string) error
- func NewUserErrorWithCause(cause error, msg string) error
- func NewUserErrorWithCausef(cause error, format string, args ...interface{}) error
- func NewUserErrorf(format string, args ...interface{}) error
- func SafeCall(toCall func() error, err *error)
- func SafeClose(toClose io.Closer, err *error)
- func SafeDrainAndClose(toClose io.ReadCloser, err *error)
- type CorrelationError
- type UserError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextDone ¶
func MaybeWrapWithCorrelationId ¶ added in v14.1.0
func NewUserError ¶
func NewUserErrorWithCause ¶
func NewUserErrorWithCausef ¶
func NewUserErrorf ¶
func SafeDrainAndClose ¶ added in v14.1.0
func SafeDrainAndClose(toClose io.ReadCloser, err *error)
Types ¶
type CorrelationError ¶ added in v14.1.0
type CorrelationError struct {
// Err holds the wrapped error.
Err error
// CorrelationId holds the correlation id.
CorrelationId string
}
CorrelationError wraps an error to add a correlation id.
func (CorrelationError) Error ¶ added in v14.1.0
func (e CorrelationError) Error() string
func (CorrelationError) Unwrap ¶ added in v14.1.0
func (e CorrelationError) Unwrap() error
type UserError ¶
type UserError struct {
// Message is a textual description of what's wrong.
// Must be suitable to show to the user.
Message string
// Cause optionally holds an underlying error.
Cause error
}
UserError is an error that happened because the user messed something up: - invalid syntax - invalid configuration
Click to show internal directories.
Click to hide internal directories.