Documentation ¶
Index ¶
- func IsMap(err error) bool
- func IsSlice(err error) bool
- func MarshalToJSON(writer io.Writer, err error, additionalErrors ...error) error
- func MarshalToObject(err error, additionalErrors ...error) map[string]interface{}
- func MarshalToYAML(writer io.Writer, err error, additionalErrors ...error) error
- func WithStack(err error) error
- func Wrap(err error, message string) error
- func Wrapf(err error, format string, args ...interface{}) error
- type Error
- type Map
- type Slice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalToJSON ¶
MarshalToJSON an error to a json encoded error object
func MarshalToObject ¶
MarshalToObject marshals to a map[string]interface{}, usable to marshal to different formats
func MarshalToYAML ¶
MarshalToYAML marshals an error to a yaml encoded error object
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is a marshalable error note that you loose any extra information other than the actual message when marshaling/unmarshaling
func New ¶
func New(e interface{}) *Error
New creates a new marshalable error it may take a string or another error
func (*Error) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface
func (*Error) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface
type Map ¶
Map is a map from string to error
Click to show internal directories.
Click to hide internal directories.