errors

package
v0.0.0-...-604993b Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: ISC Imports: 3 Imported by: 0

Documentation

Overview

Package errors defines a set of annotations to be used when translating between fs.PathError and non-Go error values.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupported = errors.ErrUnsupported

Functions

func New

func New(op, path string, err error, kind Kind) error

Types

type Error

type Error struct {
	fs.PathError
	Kind
}

Error wraps a fs.PathError with an error Kind.

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Kind

type Kind uint8

Kind specifies a type of error.

const (
	Other            Kind = iota // Unclassified error.
	InvalidItem                  // Invalid operation for the item being operated on.
	InvalidOperation             // Operation itself is not valid within the system.
	Permission                   // Permission denied.
	IO                           // External I/O error such as network failure.
	Exist                        // Item already exists.
	NotExist                     // Item does not exist.
	IsDir                        // Item is a directory.
	NotDir                       // Item is not a directory.
	NotEmpty                     // Directory not empty.
	ReadOnly                     // File system has no modification capabilities.
)

func (Kind) String

func (i Kind) String() string

Jump to

Keyboard shortcuts

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