domain

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package domain contains domain errors used throughout the application.

Index

Constants

View Source
const (
	ErrCodeClaudeAlreadyRunning = "CLAUDE_ALREADY_RUNNING"
	ErrCodeClaudeNotRunning     = "CLAUDE_NOT_RUNNING"
	ErrCodeInvalidCommand       = "INVALID_COMMAND"
	ErrCodeInvalidPayload       = "INVALID_PAYLOAD"
	ErrCodePathOutsideRepo      = "PATH_OUTSIDE_REPO"
	ErrCodeFileNotFound         = "FILE_NOT_FOUND"
	ErrCodeFileTooLarge         = "FILE_TOO_LARGE"
	ErrCodeGitError             = "GIT_ERROR"
	ErrCodeInternalError        = "INTERNAL_ERROR"
)

Error codes for client responses.

Variables

View Source
var (
	ErrClaudeAlreadyRunning = errors.New("claude is already running")
	ErrClaudeNotRunning     = errors.New("claude is not running")
	ErrInvalidPrompt        = errors.New("invalid prompt: prompt cannot be empty")
	ErrPromptTooLong        = errors.New("prompt exceeds maximum length")
	ErrRepoNotFound         = errors.New("repository not found")
	ErrNotGitRepo           = errors.New("not a git repository")
	ErrPathOutsideRepo      = errors.New("path is outside repository")
	ErrFileTooLarge         = errors.New("file exceeds size limit")
	ErrFileNotFound         = errors.New("file not found")
	ErrInvalidCommand       = errors.New("invalid command")
	ErrInvalidPayload       = errors.New("invalid payload")
	ErrHubNotRunning        = errors.New("event hub is not running")
	ErrSubscriberClosed     = errors.New("subscriber is closed")
)

Sentinel errors for common error conditions.

Functions

This section is empty.

Types

type ClaudeError

type ClaudeError struct {
	Op       string // Operation that failed
	Err      error  // Underlying error
	ExitCode int    // Exit code if process exited
}

ClaudeError represents an error from Claude CLI operations.

func NewClaudeError

func NewClaudeError(op string, err error, exitCode int) *ClaudeError

NewClaudeError creates a new ClaudeError.

func (*ClaudeError) Error

func (e *ClaudeError) Error() string

func (*ClaudeError) Unwrap

func (e *ClaudeError) Unwrap() error

type GitError

type GitError struct {
	Op  string // Operation that failed
	Err error  // Underlying error
}

GitError represents an error from Git operations.

func NewGitError

func NewGitError(op string, err error) *GitError

NewGitError creates a new GitError.

func (*GitError) Error

func (e *GitError) Error() string

func (*GitError) Unwrap

func (e *GitError) Unwrap() error

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

ValidationError represents a validation error.

func NewValidationError

func NewValidationError(field, message string) *ValidationError

NewValidationError creates a new ValidationError.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Directories

Path Synopsis
Package events defines domain events for the cdev system.
Package events defines domain events for the cdev system.
Package ports defines the interfaces (ports) for the hexagonal architecture.
Package ports defines the interfaces (ports) for the hexagonal architecture.

Jump to

Keyboard shortcuts

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