Documentation
¶
Index ¶
- func Is(err error, code ErrorCode) bool
- type ErrorCode
- type GroveError
- func CommandFailed(cmd string, err error) *GroveError
- func ConfigInvalid(reason string) *GroveError
- func ConfigNotFound(path string) *GroveError
- func ContainerTimeout(service string, timeout string) *GroveError
- func New(code ErrorCode, message string) *GroveError
- func PortConflict(port int, service string) *GroveError
- func ServiceNotFound(service string) *GroveError
- func Wrap(err error, code ErrorCode, message string) *GroveError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorCode ¶
type ErrorCode string
ErrorCode represents a specific error condition
const ( // Configuration errors ErrCodeConfigNotFound ErrorCode = "CONFIG_NOT_FOUND" ErrCodeConfigInvalid ErrorCode = "CONFIG_INVALID" ErrCodeConfigValidation ErrorCode = "CONFIG_VALIDATION" // Container runtime errors ErrCodeContainerNotRunning ErrorCode = "CONTAINER_NOT_RUNNING" ErrCodeContainerTimeout ErrorCode = "CONTAINER_TIMEOUT" ErrCodeComposeNotFound ErrorCode = "COMPOSE_NOT_FOUND" ErrCodeServiceNotFound ErrorCode = "SERVICE_NOT_FOUND" ErrCodeServiceNotRunning ErrorCode = "SERVICE_NOT_RUNNING" // Network errors ErrCodePortConflict ErrorCode = "PORT_CONFLICT" ErrCodeNetworkCreate ErrorCode = "NETWORK_CREATE" // Command execution errors ErrCodeCommandTimeout ErrorCode = "COMMAND_TIMEOUT" ErrCodeCommandNotFound ErrorCode = "COMMAND_NOT_FOUND" ErrCodeCommandFailed ErrorCode = "COMMAND_FAILED" // Git errors ErrCodeGitNotInstalled ErrorCode = "GIT_NOT_INSTALLED" ErrCodeGitCloneFailed ErrorCode = "GIT_CLONE_FAILED" ErrCodeGitDirty ErrorCode = "GIT_DIRTY" // General errors ErrCodeInternal ErrorCode = "INTERNAL_ERROR" ErrCodeInvalidInput ErrorCode = "INVALID_INPUT" ErrCodePermissionDenied ErrorCode = "PERMISSION_DENIED" )
type GroveError ¶
type GroveError struct {
Code ErrorCode `json:"code"`
Message string `json:"message"`
Details map[string]interface{} `json:"details,omitempty"`
Cause error `json:"-"`
}
GroveError represents a structured error with context
func CommandFailed ¶
func CommandFailed(cmd string, err error) *GroveError
CommandFailed creates a command execution failure error
func ConfigInvalid ¶
func ConfigInvalid(reason string) *GroveError
ConfigInvalid creates an invalid configuration error
func ConfigNotFound ¶
func ConfigNotFound(path string) *GroveError
ConfigNotFound creates a configuration not found error
func ContainerTimeout ¶
func ContainerTimeout(service string, timeout string) *GroveError
ContainerTimeout creates a container timeout error
func PortConflict ¶
func PortConflict(port int, service string) *GroveError
PortConflict creates a port conflict error
func ServiceNotFound ¶
func ServiceNotFound(service string) *GroveError
ServiceNotFound creates a service not found error
func Wrap ¶
func Wrap(err error, code ErrorCode, message string) *GroveError
Wrap wraps an existing error with a GroveError
func (*GroveError) Unwrap ¶
func (e *GroveError) Unwrap() error
Unwrap implements the errors.Unwrap interface
func (*GroveError) WithDetail ¶
func (e *GroveError) WithDetail(key string, value interface{}) *GroveError
WithDetail adds a detail to the error
Click to show internal directories.
Click to hide internal directories.