syserror

package
v0.0.0-...-23e6066 Latest Latest
Warning

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

Go to latest
Published: May 3, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package syserror contains syscall error codes exported as error interface instead of Errno. This allows for fast comparison and returns when the comparand or return value is of type error because there is no need to convert from Errno to an interface, i.e., runtime.convT2I isn't called.

Index

Constants

This section is empty.

Variables

View Source
var (
	E2BIG        = error(syscall.E2BIG)
	EACCES       = error(syscall.EACCES)
	EAGAIN       = error(syscall.EAGAIN)
	EBADF        = error(syscall.EBADF)
	EBUSY        = error(syscall.EBUSY)
	ECHILD       = error(syscall.ECHILD)
	ECONNREFUSED = error(syscall.ECONNREFUSED)
	ECONNRESET   = error(syscall.ECONNRESET)
	EEXIST       = error(syscall.EEXIST)
	EFAULT       = error(syscall.EFAULT)
	EFBIG        = error(syscall.EFBIG)
	EIDRM        = error(syscall.EIDRM)
	EINTR        = error(syscall.EINTR)
	EINVAL       = error(syscall.EINVAL)
	EIO          = error(syscall.EIO)
	EISDIR       = error(syscall.EISDIR)
	ELIBBAD      = error(syscall.ELIBBAD)
	ELOOP        = error(syscall.ELOOP)
	EMFILE       = error(syscall.EMFILE)
	ENAMETOOLONG = error(syscall.ENAMETOOLONG)
	ENOATTR      = ENODATA
	ENODATA      = error(syscall.ENODATA)
	ENODEV       = error(syscall.ENODEV)
	ENOENT       = error(syscall.ENOENT)
	ENOEXEC      = error(syscall.ENOEXEC)
	ENOLCK       = error(syscall.ENOLCK)
	ENOLINK      = error(syscall.ENOLINK)
	ENOMEM       = error(syscall.ENOMEM)
	ENOSPC       = error(syscall.ENOSPC)
	ENOSYS       = error(syscall.ENOSYS)
	ENOTDIR      = error(syscall.ENOTDIR)
	ENOTEMPTY    = error(syscall.ENOTEMPTY)
	ENOTSUP      = error(syscall.ENOTSUP)
	ENOTTY       = error(syscall.ENOTTY)
	ENXIO        = error(syscall.ENXIO)
	EOPNOTSUPP   = error(syscall.EOPNOTSUPP)
	EOVERFLOW    = error(syscall.EOVERFLOW)
	EPERM        = error(syscall.EPERM)
	EPIPE        = error(syscall.EPIPE)
	ERANGE       = error(syscall.ERANGE)
	EROFS        = error(syscall.EROFS)
	ESPIPE       = error(syscall.ESPIPE)
	ESRCH        = error(syscall.ESRCH)
	ETIMEDOUT    = error(syscall.ETIMEDOUT)
	EUSERS       = error(syscall.EUSERS)
	EWOULDBLOCK  = error(syscall.EWOULDBLOCK)
	EXDEV        = error(syscall.EXDEV)
)

The following variables have the same meaning as their syscall equivalent.

View Source
var (
	// ErrWouldBlock is an internal error used to indicate that an operation
	// cannot be satisfied immediately, and should be retried at a later
	// time, possibly when the caller has received a notification that the
	// operation may be able to complete. It is used by implementations of
	// the kio.File interface.
	ErrWouldBlock = errors.New("request would block")

	// ErrInterrupted is returned if a request is interrupted before it can
	// complete.
	ErrInterrupted = errors.New("request was interrupted")

	// ErrExceedsFileSizeLimit is returned if a request would exceed the
	// file's size limit.
	ErrExceedsFileSizeLimit = errors.New("exceeds file size limit")
)

Functions

func AddErrorTranslation

func AddErrorTranslation(from error, to syscall.Errno) bool

AddErrorTranslation allows modules to populate the error map by adding their own translations during initialization. Returns if the error translation is accepted or not. A pre-existing translation will not be overwritten by the new translation.

func AddErrorUnwrapper

func AddErrorUnwrapper(unwrap func(e error) (syscall.Errno, bool))

AddErrorUnwrapper registers an unwrap method that can extract a concrete error from a typed, but not initialized, error.

func ConvertIntr

func ConvertIntr(err, intr error) error

ConvertIntr converts the provided error code (err) to another one (intr) if the first error corresponds to an interrupted operation.

func TranslateError

func TranslateError(from error) (syscall.Errno, bool)

TranslateError translates errors to errnos, it will return false if the error was not registered.

Types

This section is empty.

Jump to

Keyboard shortcuts

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