Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogErrorChain ¶
func LogErrorChain(err error)
LogErrorChain logs an error chain to the console.
func LogErrorChainWithAttrs ¶
func LogErrorChainWithAttrs(err error)
LogErrorChainWithAttrs logs an error chain with additional attributes in a structured format.
Types ¶
type TempoError ¶
type TempoError struct {
Code int // Error code
Message string // Context message for the error
Cause error // Underlying cause of the error, if any
Attrs map[string]any // Additional attributes for the error
}
TempoError represents an error with an additional context message, cause, and attributes.
func NewTempoError ¶
func NewTempoError(message string, cause error) *TempoError
NewTempoError creates a new TempoError instance.
func (*TempoError) Error ¶
func (e *TempoError) Error() string
Error returns the context message of the TempoError.
func (*TempoError) ToJSON ¶
func (e *TempoError) ToJSON() ([]byte, error)
func (*TempoError) Unwrap ¶
func (e *TempoError) Unwrap() error
Unwrap returns the underlying cause of the error, if any.
func (*TempoError) WithAttr ¶
func (e *TempoError) WithAttr(key string, value any) *TempoError
WithAttr adds a key-value pair to the attributes and returns the updated error.
func (*TempoError) WithCode ¶
func (e *TempoError) WithCode(code int) *TempoError
WithCode adds an error code to the TempoError and returns the updated error.
Click to show internal directories.
Click to hide internal directories.