errors

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrTypeValidation = "validation"
	ErrTypeConfig     = "configuration"
	ErrTypeExecution  = "execution"
)

Error types for different categories of errors

View Source
const (
	ErrCodeInvalidConfig    = "INVALID_CONFIG"
	ErrCodeCommandFailed    = "COMMAND_FAILED"
	ErrCodePermissionDenied = "PERMISSION_DENIED"
)

Error codes for specific error conditions

Variables

This section is empty.

Functions

This section is empty.

Types

type MoleyError

type MoleyError struct {
	Type       string            `json:"type"`
	Code       string            `json:"code"`
	Message    string            `json:"message"`
	Details    map[string]string `json:"details,omitempty"`
	Underlying error             `json:"-"`
	Context    map[string]string `json:"context,omitempty"`
}

MoleyError represents a structured error with additional context

func NewConfigError

func NewConfigError(code, message string, underlying error) *MoleyError

NewConfigError creates a new configuration error

func NewExecutionError

func NewExecutionError(code, message string, underlying error) *MoleyError

NewExecutionError creates a new execution error

func NewValidationError

func NewValidationError(code, message string, underlying error) *MoleyError

NewValidationError creates a new validation error

func (*MoleyError) Error

func (e *MoleyError) Error() string

Error implements the error interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL