errors

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoChanges             = NewAppError(TypeGit, "no staged changes detected", nil)
	ErrGetBranch             = NewAppError(TypeGit, "failed to get current branch", nil)
	ErrNoBranch              = NewAppError(TypeGit, "no branch detected", nil)
	ErrGetRepoRoot           = NewAppError(TypeGit, "failed to get repository root", nil)
	ErrGetRepoURL            = NewAppError(TypeGit, "failed to get repository URL", nil)
	ErrGetCommits            = NewAppError(TypeGit, "failed to get commits", nil)
	ErrGetCommitCount        = NewAppError(TypeGit, "failed to get commit count", nil)
	ErrGetRecentCommits      = NewAppError(TypeGit, "failed to get recent commit messages", nil)
	ErrAddFile               = NewAppError(TypeGit, "failed to add file to staging", nil)
	ErrExtractRepoInfo       = NewAppError(TypeGit, "failed to extract repository info", nil)
	ErrCreateTag             = NewAppError(TypeGit, "failed to create tag", nil)
	ErrPushTag               = NewAppError(TypeGit, "failed to push tag", nil)
	ErrPush                  = NewAppError(TypeGit, "failed to push to remote", nil)
	ErrFetchTags             = NewAppError(TypeGit, "failed to fetch tags from remote", nil)
	ErrCreateCommit          = NewAppError(TypeGit, "failed to create commit", nil)
	ErrGetDiff               = NewAppError(TypeGit, "failed to get diff", nil)
	ErrNoDiff                = NewAppError(TypeGit, "no differences detected", nil)
	ErrInvalidBranch         = NewAppError(TypeGit, "must be on main or master branch to create releases", nil)
	ErrTagNotFound           = NewAppError(TypeGit, "tag not found in repository history", nil)
	ErrInvalidTagFormat      = NewAppError(TypeGit, "tag does not match semver format (vX.Y.Z)", nil)
	ErrValidateTag           = NewAppError(TypeGit, "failed to validate tag existence", nil)
	ErrGetChangedFiles       = NewAppError(TypeGit, "failed to get changed files", nil)
	ErrGetTagDate            = NewAppError(TypeGit, "failed to get tag date", nil)
	ErrGetGitUser            = NewAppError(TypeGit, "failed to get git user configuration", nil)
	ErrGitUserNotConfigured  = NewAppError(TypeGit, "git user.name not configured", nil)
	ErrGitEmailNotConfigured = NewAppError(TypeGit, "git user.email not configured", nil)
	ErrNotInGitRepo          = NewAppError(TypeGit, "not in a git repository", nil)
)

Git errors

View Source
var (
	ErrAPIKeyMissing = NewAppError(TypeConfiguration, "AI API key is missing", nil)
	ErrTokenMissing  = NewAppError(TypeConfiguration, "VCS token is missing", nil)
	ErrConfigMissing = NewAppError(TypeConfiguration, "configuration is missing", nil)
)

Configuration errors

View Source
var (
	ErrRepositoryNotFound = NewAppError(TypeVCS, "repository not found", nil)
	ErrVCSNotSupported    = NewAppError(TypeVCS, "VCS provider not supported", nil)
	ErrCreateRelease      = NewAppError(TypeVCS, "failed to create release", nil)
	ErrUpdateRelease      = NewAppError(TypeVCS, "failed to update release", nil)
	ErrGetRelease         = NewAppError(TypeVCS, "failed to get release", nil)
	ErrUploadAsset        = NewAppError(TypeVCS, "failed to upload release asset", nil)
)

VCS errors

View Source
var (
	ErrGitHubTokenInvalid      = NewAppError(TypeVCS, "GitHub token is invalid or expired", nil)
	ErrGitHubInsufficientPerms = NewAppError(TypeVCS, "GitHub token has insufficient permissions", nil)
	ErrGitHubRateLimit         = NewAppError(TypeVCS, "GitHub API rate limit exceeded", nil)
)

GitHub/VCS specific errors

View Source
var (
	ErrQuotaExceeded   = NewAppError(TypeAI, "AI quota exceeded or rate limited", nil)
	ErrAIGeneration    = NewAppError(TypeAI, "AI generation failed", nil)
	ErrInvalidAIOutput = NewAppError(TypeAI, "invalid AI output format", nil)
)

AI errors

View Source
var (
	ErrGeminiAPIKeyInvalid = NewAppError(TypeAI, "Gemini API key is invalid", nil)
	ErrGeminiQuotaExceeded = NewAppError(TypeAI, "Gemini API quota exceeded", nil)
)

Gemini/AI specific errors

View Source
var (
	ErrBuildNoVersion      = NewAppError(TypeInternal, "build version not specified", nil)
	ErrBuildNoCommit       = NewAppError(TypeInternal, "build commit not specified", nil)
	ErrBuildNoBuildDir     = NewAppError(TypeInternal, "build directory not specified", nil)
	ErrBuildNoDate         = NewAppError(TypeInternal, "build date not specified", nil)
	ErrBuildFailed         = NewAppError(TypeInternal, "build operation failed", nil)
	ErrVersionFileNotFound = NewAppError(TypeInternal, "version file not found", nil)
)
View Source
var (
	ErrUpdateFailed = NewAppError(TypeUpdate, "failed to update application", nil)
)

Update errors

Functions

This section is empty.

Types

type AppError

type AppError struct {
	Type    ErrorType
	Message string
	Context map[string]interface{}
	Err     error
}

AppError represents a domain-level error with a type and an underlying error

func NewAppError

func NewAppError(t ErrorType, msg string, err error) *AppError

NewAppError creates a new AppError

func (*AppError) Error

func (e *AppError) Error() string

func (*AppError) Unwrap

func (e *AppError) Unwrap() error

func (*AppError) WithContext

func (e *AppError) WithContext(key string, value interface{}) *AppError

WithContext creates a new AppError with additional context

func (*AppError) WithError

func (e *AppError) WithError(err error) *AppError

WithError creates a new AppError with an underlying error

type ErrorType

type ErrorType string

ErrorType defines the category of the error

const (
	TypeConfiguration ErrorType = "CONFIGURATION"
	TypeAI            ErrorType = "AI"
	TypeVCS           ErrorType = "VCS"
	TypeGit           ErrorType = "GIT"
	TypeInternal      ErrorType = "INTERNAL"
	TypeUpdate        ErrorType = "UPDATE"
)

Jump to

Keyboard shortcuts

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