oserror

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 3 Imported by: 45

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalid    = os.ErrInvalid
	ErrPermission = os.ErrPermission
	ErrExist      = os.ErrExist
	ErrNotExist   = os.ErrNotExist
	ErrClosed     = os.ErrClosed
)

Portable analogs of some common system call errors.

Errors returned from this package may be tested against these errors with errors.Is.

Functions

func IsExist

func IsExist(err error) bool

IsExist returns a boolean indicating whether the error is known to report that a file or directory already exists. It is satisfied by ErrExist as well as some syscall errors.

This function differs from os.IsExist() in that it can identify an error through wrapping layers.

func IsNotExist

func IsNotExist(err error) bool

IsNotExist returns a boolean indicating whether the error is known to report that a file or directory does not exist. It is satisfied by ErrNotExist as well as some syscall errors.

This function differs from os.IsNotExist() in that it can identify an error through wrapping layers.

func IsPermission

func IsPermission(err error) bool

IsPermission returns a boolean indicating whether the error is known to report that permission is denied. It is satisfied by ErrPermission as well as some syscall errors.

This function differs from os.IsPermission() in that it can identify an error through wrapping layers.

func IsTimeout

func IsTimeout(err error) bool

IsTimeout returns a boolean indicating whether the error is known to report that a timeout occurred.

This function differs from os.IsTimeout() in that it can identify an error through wrapping layers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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