Documentation
¶
Overview ¶
Package nodeerrno maps operating-system errors to the error codes, descriptions and errnos Node reports for them. Node takes them from libuv: uv_translate_sys_error converts a Windows system error to a libuv errno (error.errno), uv_err_name names the errno (error.code), and uv_strerror describes it.
Index ¶
- func Code(errno syscall.Errno) (string, bool)
- func Describe(err error) (code, description string, errno int)
- func Description(code string) (string, bool)
- func Errno(code string) (int, bool)
- func ErrorCode(err error) string
- func FromPathError(err error) error
- func MkdirAll(dir string, perm os.FileMode) error
- func Name(errno int) (code, description string)
- type FSError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Describe ¶
Describe returns the error.code, the uv_strerror text and the error.errno of the error Node's fs module reports for err, the failure of an fs call. An error without an errno is ENOENT when it is fs.ErrNotExist and UNKNOWN otherwise.
func Description ¶
Description returns libuv's uv_strerror text for a Node error code.
func Errno ¶
Errno returns the errno Node reports (error.errno) for code: the negated POSIX errno, which libuv passes through, when the platform defines one for the code, and libuv's own value otherwise.
func ErrorCode ¶
ErrorCode returns the Node error code (error.code) for the syscall.Errno that err wraps, or "" when err wraps none or its errno has no code here.
func FromPathError ¶
FromPathError reports err, a failed Go file operation, as the Node fs call behind it. open keeps its path; read, write and close act on a file descriptor, and Node names no path for them. Any other error is returned unchanged.
Types ¶
type FSError ¶
FSError is the error Node's fs module reports for a failed call. Its message is Node's: "<CODE>: <description>, <syscall> '<path>'", without the path for a call on a file descriptor. Code, when set, is the code Node reports in place of the one Describe finds for Err. Unwrap returns the Go error.