Documentation ¶
Index ¶
- Constants
- func ErrorToWaitStatus(err error) (syscall.WaitStatus, bool)
- func IsExecFormatError(err error) bool
- func IsInvoked(err error) bool
- func IsNotExist(err error) bool
- func IsNotFoundInPATH(err error) bool
- func IsPermission(err error) bool
- func ResolveExitCode(err error) int
- func SeparateArgs(args []string) ([]string, []string)
- func WaitStatusToExitCode(st syscall.WaitStatus) int
- type ExitStatus
Constants ¶
const ( ExitNormal = 0 ExitUnknownErr = 125 ExitCommandNotInvoked = 126 ExitCommandNotFound = 127 )
exit statuses are same with GNU coreutils
Variables ¶
This section is empty.
Functions ¶
func ErrorToWaitStatus ¶
func ErrorToWaitStatus(err error) (syscall.WaitStatus, bool)
ErrorToWaitStatus try to convert error into syscall.WaitStatus
func IsExecFormatError ¶
IsExecFormatError returns a boolean indicating whether the error is known to report that format of an executable file is invalid. ex. "fork/exec ./prog: exec format error"
func IsInvoked ¶
IsInvoked returns a boolean indicating whether the error is known to report that the command is invoked or not.
func IsNotFoundInPATH ¶
IsNotFoundInPATH returns a boolean indicating whether the error is known to report that a prog is not found in $PATH. ex. "exec: \"prog\": executable file not found in $PATH"
func IsPermission ¶
IsPermission is alias of os.IsPermission for now
func ResolveExitCode ¶
ResolveExitCode retruns a int as command exit code from an error.
func SeparateArgs ¶
SeparateArgs separates command line arguments for wrapper command.
func WaitStatusToExitCode ¶
func WaitStatusToExitCode(st syscall.WaitStatus) int
WaitStatusToExitCode converts WaitStatus to ExitCode
Types ¶
type ExitStatus ¶
type ExitStatus struct {
// contains filtered or unexported fields
}
ExitStatus represents command exit status information
func ResolveExitStatus ¶
func ResolveExitStatus(err error) *ExitStatus
ResolveExitStatus resolve ExitStatus from command error
func (*ExitStatus) Signal ¶
func (es *ExitStatus) Signal() syscall.Signal
Signal returns a received signal