Documentation
¶
Index ¶
- Variables
- func As(err error, target interface{}) bool
- func Is(err, target error) bool
- func NewFileError(path, op string, wrapped error) error
- func NewPackageError(op, pkg, version string, wrapped error) error
- func NewVCSError(op, path string, wrapped error) error
- func NewValidationError(field, message string) error
- func Wrap(err error, message string) error
- type FileError
- type PackageError
- type VCSError
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("resource not found") ErrInvalidArgument = errors.New("invalid argument") ErrInvalidOperation = errors.New("invalid operation") ErrInternal = errors.New("internal error") )
Common errors that can be used across packages
Functions ¶
func As ¶
As finds the first error in err's chain that matches target. It enables errors.As() to work with our custom error types.
func Is ¶
Is reports whether target matches err. It enables errors.Is() to work with our custom error types.
func NewFileError ¶
NewFileError creates a new FileError
func NewPackageError ¶
NewPackageError creates a new PackageError
func NewVCSError ¶
NewVCSError creates a new VCSError
func NewValidationError ¶
NewValidationError creates a new ValidationError
Types ¶
type PackageError ¶
PackageError represents an error that occurs during package operations
func (*PackageError) Error ¶
func (e *PackageError) Error() string
func (*PackageError) Unwrap ¶
func (e *PackageError) Unwrap() error
type ValidationError ¶
ValidationError represents an error that occurs during validation
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.