errors

package
v1.2.1 Latest Latest
Warning

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

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

Documentation

Overview

Package errors provides custom error types and error handling utilities.

Index

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 DieIf

func DieIf(err error)

DieIf exits with an error message if the error is not nil

func DieIfWithMsg

func DieIfWithMsg(err error, msg string)

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 WarnIf

func WarnIf(err error)

WarnIf prints a warning if the error is not nil

func WarnIfWithMsg

func WarnIfWithMsg(err error, msg string)

WarnIfWithMsg prints a custom warning if the error is not nil

func Wrap

func Wrap(err error, context string) error

Wrap wraps an error with additional context

func Wrapf

func Wrapf(err error, format string, args ...interface{}) error

Wrapf wraps an error with formatted context

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

type ErrInvalidCommand struct {
	Command string
	Valid   []string
}

ErrInvalidCommand indicates an invalid command was provided

func (ErrInvalidCommand) Error

func (e ErrInvalidCommand) Error() string

type ErrInvalidConfig

type ErrInvalidConfig struct {
	Key    string
	Reason string
}

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

Jump to

Keyboard shortcuts

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