Documentation
¶
Overview ¶
Package errors provides error types and utilities for the toolhive application.
Index ¶
- Constants
- func IsContainerAlreadyExists(err error) bool
- func IsContainerAlreadyRunning(err error) bool
- func IsContainerNotFound(err error) bool
- func IsContainerNotRunning(err error) bool
- func IsContainerRuntime(err error) bool
- func IsGroupAlreadyExists(err error) bool
- func IsGroupNotFound(err error) bool
- func IsInternal(err error) bool
- func IsInvalidArgument(err error) bool
- func IsPermissions(err error) bool
- func IsRunConfigNotFound(err error) bool
- func IsTransport(err error) bool
- type Error
- func NewContainerAlreadyExistsError(message string, cause error) *Error
- func NewContainerAlreadyRunningError(message string, cause error) *Error
- func NewContainerNotFoundError(message string, cause error) *Error
- func NewContainerNotRunningError(message string, cause error) *Error
- func NewContainerRuntimeError(message string, cause error) *Error
- func NewError(errorType, message string, cause error) *Error
- func NewGroupAlreadyExistsError(message string, cause error) *Error
- func NewGroupNotFoundError(message string, cause error) *Error
- func NewInternalError(message string, cause error) *Error
- func NewInvalidArgumentError(message string, cause error) *Error
- func NewPermissionsError(message string, cause error) *Error
- func NewRunConfigNotFoundError(message string, cause error) *Error
- func NewTransportError(message string, cause error) *Error
Constants ¶
const ( // ErrInvalidArgument is returned when an invalid argument is provided ErrInvalidArgument = "invalid_argument" // ErrContainerRuntime is returned when there is an error with the container runtime ErrContainerRuntime = "container_runtime" // ErrContainerNotFound is returned when a container is not found ErrContainerNotFound = "container_not_found" // ErrContainerAlreadyExists is returned when a container already exists ErrContainerAlreadyExists = "container_already_exists" // ErrContainerNotRunning is returned when a container is not running ErrContainerNotRunning = "container_not_running" // ErrContainerAlreadyRunning is returned when a container is already running ErrContainerAlreadyRunning = "container_already_running" // ErrRunConfigNotFound is returned when a run configuration is not found ErrRunConfigNotFound = "run_config_not_found" // ErrGroupAlreadyExists is returned when a group already exists ErrGroupAlreadyExists = "group_already_exists" // ErrGroupNotFound is returned when a group is not found ErrGroupNotFound = "group_not_found" // ErrTransport is returned when there is an error with the transport ErrTransport = "transport" // ErrPermissions is returned when there is an error with permissions ErrPermissions = "permissions" // ErrInternal is returned when there is an internal error ErrInternal = "internal" )
Error types
Variables ¶
This section is empty.
Functions ¶
func IsContainerAlreadyExists ¶
IsContainerAlreadyExists checks if the error is a container already exists error
func IsContainerAlreadyRunning ¶
IsContainerAlreadyRunning checks if the error is a container already running error
func IsContainerNotFound ¶
IsContainerNotFound checks if the error is a container not found error
func IsContainerNotRunning ¶
IsContainerNotRunning checks if the error is a container not running error
func IsContainerRuntime ¶
IsContainerRuntime checks if the error is a container runtime error
func IsGroupAlreadyExists ¶ added in v0.2.3
IsGroupAlreadyExists checks if the error is a group already exists error
func IsGroupNotFound ¶ added in v0.2.3
IsGroupNotFound checks if the error is a group not found error
func IsInternal ¶
IsInternal checks if the error is an internal error
func IsInvalidArgument ¶
IsInvalidArgument checks if the error is an invalid argument error
func IsPermissions ¶
IsPermissions checks if the error is a permissions error
func IsRunConfigNotFound ¶ added in v0.2.1
IsRunConfigNotFound checks if the error is a run configuration not found error
func IsTransport ¶
IsTransport checks if the error is a transport error
Types ¶
type Error ¶
type Error struct { // Type is the error type Type string // Message is the error message Message string // Cause is the underlying error Cause error }
Error represents an error in the application
func NewContainerAlreadyExistsError ¶
NewContainerAlreadyExistsError creates a new container already exists error
func NewContainerAlreadyRunningError ¶
NewContainerAlreadyRunningError creates a new container already running error
func NewContainerNotFoundError ¶
NewContainerNotFoundError creates a new container not found error
func NewContainerNotRunningError ¶
NewContainerNotRunningError creates a new container not running error
func NewContainerRuntimeError ¶
NewContainerRuntimeError creates a new container runtime error
func NewGroupAlreadyExistsError ¶ added in v0.2.3
NewGroupAlreadyExistsError creates a new group already exists error
func NewGroupNotFoundError ¶ added in v0.2.3
NewGroupNotFoundError creates a new group not found error
func NewInternalError ¶
NewInternalError creates a new internal error
func NewInvalidArgumentError ¶
NewInvalidArgumentError creates a new invalid argument error
func NewPermissionsError ¶
NewPermissionsError creates a new permissions error
func NewRunConfigNotFoundError ¶ added in v0.2.1
NewRunConfigNotFoundError creates a new run configuration not found error
func NewTransportError ¶
NewTransportError creates a new transport error