Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Wrap ¶
Wrap wraps an error with another error.
It is a interface for errors.Join. Check errors.Join for more information.
Types ¶
type Data ¶
type Data interface{}
Data is a custom type to carry error's metadata. It can be any data type, but a struct is recommended due its fine control on JSON marshalling for each field.
type Error ¶
type Error struct {
// message is the error message.
Message string `json:"message"`
// Layer is the error layer.
Layer string `json:"layer,omitempty"`
// Code is the error code.
Code int `json:"code,omitempty"`
// Data is the error metadata.
Data Data `json:"data,omitempty"`
}
Error is a custom error that carry attributes to specify error's message, resource, layer, code and data.
Click to show internal directories.
Click to hide internal directories.