Documentation
¶
Overview ¶
Package err provides functionalities for error handling in a structured manner. It defines a custom error type 'Err' that encapsulates an error with a caller and a message. This package is designed to provide more context about where an error was thrown.
The Err struct contains two fields: 'caller' and 'message'. 'caller' represents the origin of the error, and 'message' provides details about the error.
There are three main methods associated with the Err struct: - New: creates a new instance of Err with the specified caller and an empty message. - Throwf: formats an error message according to a format specifier. - Throw: updates the message of the Err with the passed message.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Err ¶
type Err struct {
// contains filtered or unexported fields
}
Err is an exported type that encapsulates an error with a caller and a message.
func New ¶
New create new instance of Err with specified caller and an empty message. It returns the pointer to the created Err.
func (*Err) Error ¶
Error returns a string that represents the Err. It combines the caller and the message of the Err.