errors

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound       = errors.New("not found")
	ErrAlreadyExists  = errors.New("already exists")
	ErrNotInitialized = errors.New("not initialized")
	ErrInvalidInput   = errors.New("invalid input")
	ErrAmbiguous      = errors.New("ambiguous match")
)

Standard sentinel errors for type checking

Functions

func BoardAlreadyExists

func BoardAlreadyExists(name string) error

func BoardNotFound

func BoardNotFound(name string) error

func CardNotFound

func CardNotFound(idOrAlias string) error

func ColumnAlreadyExists added in v0.5.0

func ColumnAlreadyExists(name, board string) error

func ColumnLimitExceeded added in v0.14.0

func ColumnLimitExceeded(columnName string, limit int) error

func ColumnNotFound

func ColumnNotFound(name, board string) error

func CommentNotFound added in v0.7.1

func CommentNotFound(id string) error

func InvalidField

func InvalidField(field, message string) error

func IsAlreadyExists

func IsAlreadyExists(err error) bool

IsAlreadyExists checks if an error is an already-exists error.

func IsAmbiguous added in v0.24.0

func IsAmbiguous(err error) bool

IsAmbiguous reports whether err indicates an ambiguous fuzzy match.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound checks if an error is a not-found error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError checks if an error is a validation error.

func NewAmbiguousCardError added in v0.24.0

func NewAmbiguousCardError(input string, matches []AmbiguousMatch, displayLimit int) error

NewAmbiguousCardError builds an AmbiguousCardError. The full match list is stored on the error; displayLimit controls how many are shown by Error() (Error() renders "(showing N of M)" when truncation happens). Pass 0 to disable the display cap.

Types

type AlreadyExistsError

type AlreadyExistsError struct {
	Resource string
	ID       string
}

AlreadyExistsError indicates a resource already exists.

func (*AlreadyExistsError) Error

func (e *AlreadyExistsError) Error() string

func (*AlreadyExistsError) Unwrap

func (e *AlreadyExistsError) Unwrap() error

type AmbiguousCardError added in v0.24.0

type AmbiguousCardError struct {
	Input        string
	Matches      []AmbiguousMatch
	DisplayLimit int
}

AmbiguousCardError indicates a fuzzy lookup matched multiple cards and the user must disambiguate. Matches contains the full list (pre-sorted); DisplayLimit caps how many entries Error() renders. Storing the full list lets callers like cross-board aggregation reuse the data without losing truncated matches.

func (*AmbiguousCardError) Error added in v0.24.0

func (e *AmbiguousCardError) Error() string

func (*AmbiguousCardError) Unwrap added in v0.24.0

func (e *AmbiguousCardError) Unwrap() error

type AmbiguousMatch added in v0.24.0

type AmbiguousMatch struct {
	Alias string
	ID    string
}

AmbiguousMatch is one candidate in an AmbiguousCardError list.

type NoGlobalBoardError added in v0.26.0

type NoGlobalBoardError struct{}

NoGlobalBoardError indicates -g was used but no global board is designated.

func (*NoGlobalBoardError) Error added in v0.26.0

func (e *NoGlobalBoardError) Error() string

type NotFoundError

type NotFoundError struct {
	Resource string // "card", "board", "config"
	ID       string // The identifier that wasn't found
}

NotFoundError indicates a resource doesn't exist.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

func (*NotFoundError) Unwrap

func (e *NotFoundError) Unwrap() error

type NotInitializedError

type NotInitializedError struct {
	Path string
}

NotInitializedError indicates Kan isn't set up in the repo.

func (*NotInitializedError) Error

func (e *NotInitializedError) Error() string

func (*NotInitializedError) Unwrap

func (e *NotInitializedError) Unwrap() error

type StaleGlobalBoardError added in v0.26.0

type StaleGlobalBoardError struct {
	Board string
	Path  string
}

StaleGlobalBoardError indicates the designated global board no longer exists (its project moved/was deleted, or the board itself was removed).

func (*StaleGlobalBoardError) Error added in v0.26.0

func (e *StaleGlobalBoardError) Error() string

type ValidationError

type ValidationError struct {
	Field   string
	Message string
}

ValidationError indicates invalid user input.

func (*ValidationError) Error

func (e *ValidationError) Error() string

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Jump to

Keyboard shortcuts

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