Documentation
¶
Overview ¶
Package errors provides custom error types and error handling utilities.
Index ¶
- func Die(msg string)
- func DieIf(err error)
- func DieIfWithMsg(err error, msg string)
- func Dief(format string, args ...interface{})
- func WarnIf(err error)
- func WarnIfWithMsg(err error, msg string)
- func Wrap(err error, context string) error
- func Wrapf(err error, format string, args ...interface{}) error
- type ErrBranchExists
- type ErrBranchNotFound
- type ErrConfigNotFound
- type ErrInvalidCommand
- type ErrInvalidConfig
- type ErrNotInGitRepo
- type ErrSessionExists
- type ErrSessionNotFound
- type ErrWorktreeExists
- type ErrWorktreeNotFound
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Die ¶
func Die(msg string)
Die prints an error message and exits with code 1 This is a convenience function that wraps ui.Die
func DieIfWithMsg ¶
DieIfWithMsg exits with a custom message if the error is not nil
func Dief ¶
func Dief(format string, args ...interface{})
Dief prints a formatted error message and exits with code 1
func WarnIfWithMsg ¶
WarnIfWithMsg prints a custom warning if the error is not nil
Types ¶
type ErrBranchExists ¶
type ErrBranchExists struct {
Branch string
}
ErrBranchExists indicates the branch already exists
func (ErrBranchExists) Error ¶
func (e ErrBranchExists) Error() string
type ErrBranchNotFound ¶
type ErrBranchNotFound struct {
Branch string
}
ErrBranchNotFound indicates the branch does not exist
func (ErrBranchNotFound) Error ¶
func (e ErrBranchNotFound) Error() string
type ErrConfigNotFound ¶
type ErrConfigNotFound struct{}
ErrConfigNotFound indicates no configuration was found
func (ErrConfigNotFound) Error ¶
func (e ErrConfigNotFound) Error() string
type ErrInvalidCommand ¶
ErrInvalidCommand indicates an invalid command was provided
func (ErrInvalidCommand) Error ¶
func (e ErrInvalidCommand) Error() string
type ErrInvalidConfig ¶
ErrInvalidConfig indicates configuration is invalid
func (ErrInvalidConfig) Error ¶
func (e ErrInvalidConfig) Error() string
type ErrNotInGitRepo ¶
type ErrNotInGitRepo struct{}
ErrNotInGitRepo indicates the current directory is not inside a git repository
func (ErrNotInGitRepo) Error ¶
func (e ErrNotInGitRepo) Error() string
type ErrSessionExists ¶
type ErrSessionExists struct {
Session string
}
ErrSessionExists indicates a tmux session already exists
func (ErrSessionExists) Error ¶
func (e ErrSessionExists) Error() string
type ErrSessionNotFound ¶
type ErrSessionNotFound struct {
Session string
}
ErrSessionNotFound indicates a tmux session was not found
func (ErrSessionNotFound) Error ¶
func (e ErrSessionNotFound) Error() string
type ErrWorktreeExists ¶
type ErrWorktreeExists struct {
Path string
}
ErrWorktreeExists indicates a worktree already exists at the path
func (ErrWorktreeExists) Error ¶
func (e ErrWorktreeExists) Error() string
type ErrWorktreeNotFound ¶
type ErrWorktreeNotFound struct {
Path string
}
ErrWorktreeNotFound indicates the worktree was not found
func (ErrWorktreeNotFound) Error ¶
func (e ErrWorktreeNotFound) Error() string