psyscall

package
v0.4.23 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: ISC Imports: 2 Imported by: 0

Documentation

Overview

psyscall has functions to examine syscall.Errno errors

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errno

func Errno(err error) (errnoValue syscall.Errno)

Errno scans an error chain for a syscall.Errno type. Errno returns syscall.Errno 0x0 if none exists. Note: syscall.Errno.Error has value receiver. Errno checks:

Errno(nil) == 0 → true.
if errno != 0 {…
int(errno) provides the numeric value.
 if errno == syscall.ENOENT…
 fmt.Printf("%v", errno) → state not recoverable
 fmt.Printf("0x%x", int(errno)) → 0x68

func IsConnectionRefused

func IsConnectionRefused(err error) (isConnectionRefused bool)

IsConnectionRefused searches the error chsin of err for syscall.ECONNREFUSED net.Dialer errors for closed socket

func IsENOENT

func IsENOENT(err error) (isENOENT bool)

IsENOENT returns true if the root cause of err is file not found. Can be used with os.Open* file not found

Types

This section is empty.

Jump to

Keyboard shortcuts

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