Documentation
¶
Index ¶
- type ErrorType
- type StructuredError
- func New(errType ErrorType, operation, message string) *StructuredError
- func NewComputationError(operation, message string) *StructuredError
- func NewConfigurationError(operation, message string) *StructuredError
- func NewNetworkError(operation, message string) *StructuredError
- func NewStorageError(operation, message string) *StructuredError
- func NewTimeoutError(operation, message string) *StructuredError
- func NewValidationError(operation, message string) *StructuredError
- func Wrap(err error, errType ErrorType, operation, message string) *StructuredError
- func WrapComputationError(err error, operation, message string) *StructuredError
- func WrapConfigurationError(err error, operation, message string) *StructuredError
- func WrapNetworkError(err error, operation, message string) *StructuredError
- func WrapStorageError(err error, operation, message string) *StructuredError
- func WrapTimeoutError(err error, operation, message string) *StructuredError
- func WrapValidationError(err error, operation, message string) *StructuredError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StructuredError ¶
type StructuredError struct {
Type ErrorType
Operation string
Message string
Cause error
Context map[string]interface{}
Stack []uintptr
}
StructuredError provides rich error context
func New ¶
func New(errType ErrorType, operation, message string) *StructuredError
New creates a new structured error
func NewComputationError ¶
func NewComputationError(operation, message string) *StructuredError
NewComputationError creates a computation error
func NewConfigurationError ¶
func NewConfigurationError(operation, message string) *StructuredError
NewConfigurationError creates a configuration error
func NewNetworkError ¶
func NewNetworkError(operation, message string) *StructuredError
NewNetworkError creates a network error
func NewStorageError ¶
func NewStorageError(operation, message string) *StructuredError
NewStorageError creates a storage error
func NewTimeoutError ¶
func NewTimeoutError(operation, message string) *StructuredError
NewTimeoutError creates a timeout error
func NewValidationError ¶
func NewValidationError(operation, message string) *StructuredError
NewValidationError creates a validation error
func Wrap ¶
func Wrap(err error, errType ErrorType, operation, message string) *StructuredError
Wrap wraps an existing error with additional context
func WrapComputationError ¶
func WrapComputationError(err error, operation, message string) *StructuredError
WrapComputationError wraps an error as a computation error
func WrapConfigurationError ¶
func WrapConfigurationError(err error, operation, message string) *StructuredError
WrapConfigurationError wraps an error as a configuration error
func WrapNetworkError ¶
func WrapNetworkError(err error, operation, message string) *StructuredError
WrapNetworkError wraps an error as a network error
func WrapStorageError ¶
func WrapStorageError(err error, operation, message string) *StructuredError
WrapStorageError wraps an error as a storage error
func WrapTimeoutError ¶
func WrapTimeoutError(err error, operation, message string) *StructuredError
WrapTimeoutError wraps an error as a timeout error
func WrapValidationError ¶
func WrapValidationError(err error, operation, message string) *StructuredError
WrapValidationError wraps an error as a validation error
func (*StructuredError) Error ¶
func (e *StructuredError) Error() string
Error implements the error interface
func (*StructuredError) Unwrap ¶
func (e *StructuredError) Unwrap() error
Unwrap returns the underlying cause
func (*StructuredError) WithContext ¶
func (e *StructuredError) WithContext(key string, value interface{}) *StructuredError
WithContext adds context information to an error