Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLastError ¶ added in v0.10.9
GetLastError returns the last error in the error's chain. If there is no next error, returns nil.
func New ¶
New creates a new Error.
An Error contains a message, message that will be showed when Error() method is called, a layer, where the error happened and a code, that should be unique in the layer.
Types ¶
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"` // Next is the next error in the error's chain. next is nil when has no more error in the error's chain. Next error `json:"next,omitempty"` }
Error is a custom error that carry attributes to specify error's message, resource, layer, code and data. Error implements error and unwrap interfaces.
Click to show internal directories.
Click to hide internal directories.