errors

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package errors provides user-friendly error helpers for the wtp CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BranchNameRequired

func BranchNameRequired(commandExample string) error

BranchNameRequired reports that a branch name argument is missing.

func BranchNotFound

func BranchNotFound(branchName string) error

BranchNotFound reports that a branch cannot be found locally or remotely.

func BranchRemovalFailed

func BranchRemovalFailed(branchName string, gitError error, isForced bool) error

BranchRemovalFailed wraps errors that occur when deleting a git branch.

func CannotRemoveCurrentWorktree

func CannotRemoveCurrentWorktree(worktreeName, path string) error

CannotRemoveCurrentWorktree indicates the user is trying to delete the active worktree.

func ConfigAlreadyExists

func ConfigAlreadyExists(configPath string) error

ConfigAlreadyExists indicates that a configuration file already exists at the target path.

func ConfigLoadFailed

func ConfigLoadFailed(configPath string, parseError error) error

ConfigLoadFailed reports a failure to read or parse the configuration file.

func DirectoryAccessFailed

func DirectoryAccessFailed(operation, path string, originalError error) error

DirectoryAccessFailed reports errors encountered while interacting with a directory path.

func GitCommandFailed

func GitCommandFailed(command, output string) error

GitCommandFailed wraps an error from a git command with the command and output details.

func HookExecutionFailed

func HookExecutionFailed(hookIndex int, hookType string, originalError error) error

HookExecutionFailed wraps an error that occurred while executing a configured hook.

func InvalidBranchName

func InvalidBranchName(branchName string) error

InvalidBranchName reports that the provided branch name violates git naming rules.

func MultipleBranchesFound

func MultipleBranchesFound(branchName string, remotes []string) error

MultipleBranchesFound reports that a branch name matches multiple remotes and needs a track specifier.

func NotInGitRepository

func NotInGitRepository() error

NotInGitRepository returns an error indicating the command must run inside a Git repository.

func ShellIntegrationRequired

func ShellIntegrationRequired() error

ShellIntegrationRequired indicates shell integration is needed for the requested command.

func UnsupportedShell

func UnsupportedShell(shell string, supportedShells []string) error

UnsupportedShell reports that the requested shell is not supported for integration.

func WorktreeCreationFailed

func WorktreeCreationFailed(path, branch string, gitError error) error

WorktreeCreationFailed wraps a git error encountered while creating a worktree.

func WorktreeNameRequiredForRemove

func WorktreeNameRequiredForRemove() error

WorktreeNameRequiredForRemove reports that a worktree name is required for removal.

func WorktreeNotFound

func WorktreeNotFound(name string, availableWorktrees []string) error

WorktreeNotFound returns an error when the requested worktree is not present.

func WorktreeRemovalFailed

func WorktreeRemovalFailed(path string, gitError error) error

WorktreeRemovalFailed returns a descriptive error when a worktree cannot be removed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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