Documentation
¶
Overview ¶
Package errors provides error handling utilities with colored terminal output for the CLI.
Index ¶
- func NewConflictingFlagsError(flagA, flagB, reason string) error
- func NewDirectoryInaccessibleError(err error) error
- func NewFlagFileError(flag, path string, err error) error
- func NewNotADirectoryError(path string) error
- func NewPathNotSpecifiedError() error
- type ErrorType
- type FlagError
- type InputDirectoryError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConflictingFlagsError ¶
NewConflictingFlagsError creates an error for two flags that cannot be used together. The message names both flags so the user can see which pair to resolve.
func NewDirectoryInaccessibleError ¶
NewDirectoryInaccessibleError creates an error for when a directory cannot be accessed.
func NewFlagFileError ¶
NewFlagFileError creates an error for a flag whose file value cannot be read.
func NewNotADirectoryError ¶
NewNotADirectoryError creates an error for when a path is not a directory.
func NewPathNotSpecifiedError ¶
func NewPathNotSpecifiedError() error
NewPathNotSpecifiedError creates an error for when a path is not specified.
Types ¶
type ErrorType ¶
type ErrorType int
func (ErrorType) IsFatalError ¶
IsFatalError returns true if the error type is fatal and should cause the program to exit.
type FlagError ¶
FlagError describes a problem with the value of a CLI flag, or with a combination of flags that express contradictory intent.
func (*FlagError) HandlerString ¶
HandlerString returns a colored error string for CLI display.
type InputDirectoryError ¶
func (*InputDirectoryError) Error ¶
func (e *InputDirectoryError) Error() string
Error implements the error interface.
func (*InputDirectoryError) HandlerString ¶
func (e *InputDirectoryError) HandlerString() string
HandlerString returns a colored error string for CLI display.