Documentation ¶
Overview ¶
Package errors defines custom errors which are widely used across Aptomi code base. One example is ErrorWithDetails, which allows to attach debug information to the error in form of multiple objects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Details ¶
type Details map[string]interface{}
Details is a type which defines a map of objects that will be attached to the error
type ErrorWithDetails ¶
type ErrorWithDetails struct {
// contains filtered or unexported fields
}
ErrorWithDetails is a custom error which stores additional information about the context in which an error occurred. It stores the context, i.e. a map of objects (or, details) in addition to the error message itself
func NewErrorWithDetails ¶
func NewErrorWithDetails(message string, details Details) *ErrorWithDetails
NewErrorWithDetails creates a new ErrorWithDetails
func (*ErrorWithDetails) Details ¶
func (err *ErrorWithDetails) Details() Details
Details returns error context, i.e. map of objects which are attached to the error
func (*ErrorWithDetails) Error ¶
func (err *ErrorWithDetails) Error() string
Error returns an error message