sysexits

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2019 License: BSD-2-Clause Imports: 1 Imported by: 45

README

sysexits.h for Go

The sysexits package exports various ExitCode values that align with /usr/include/sysexits.h. For example, instead of returning os.Exit(0) or os.Exit(1), return os.Exit(sysexits.OK) and os.Exit(sysexits.Software), respectively.

See https://godoc.org/github.com/sean-/sysexits

Documentation

Index

Constants

View Source
const (
	// OK indicates successful termination
	OK = 0

	// Base is the minimum value for an error code
	Base = 64 // base value for error messages

	// Usage indicates the command was used incorrectly, e.g., with the wrong
	// number of arguments, a bad flag, a bad syntax in a parameter, or whatever.
	Usage = 64

	// DataErr indicates the input data was incorrect in some way.  This should
	// only be used for user's data & not system files.
	DataErr = 65

	// NoInput indicates an input file (not a system file) did not exist or was
	// not readable.  This could also include errors like "No message" to a mailer
	// (if it cared to catch it).
	NoInput = 66

	// NoUser indicates the user specified did not exist.  This might be used for
	// mail addresses or remote logins.
	NoUser = 67

	// NoHost indicates the host specified did not exist.  This is used in mail
	// addresses or network requests.
	NoHost = 68

	// Unavailable indicates a service is unavailable.  This can occur if a
	// support program or file does not exist.  This can also be used as a
	// catchall message when something you wanted to do doesn't work, but you
	// don't know why.
	Unavailable = 69

	// Software indicates an internal software error has been detected.  This
	// should be limited to non-operating system related errors as possible.
	Software = 70

	// OSErr indicates an operating system error has been detected.  This is
	// intended to be used for such things as "cannot fork", "cannot create pipe",
	// or the like.  It includes things like getuid returning a user that does not
	// exist in the passwd file.
	OSErr = 71

	// OSFile indicates some system file (e.g., /etc/passwd, /etc/utmp, etc.) does
	// not exist, cannot be opened, or has some sort of error (e.g., syntax
	// error).
	OSFile = 72

	// CantCreate indcates a (user specified) output file cannot be
	// 	created.
	CantCreate = 73

	// IOErr indicates an error occurred while doing I/O on some file.
	IOErr = 74

	// TempFail indicates temporary failure, indicating something that is not
	// really an error.  In sendmail, this means that a mailer (e.g.) could not
	// create a connection, and the request should be reattempted later.
	TempFail = 75

	// Protocol indicates the remote system returned something that was "not
	// possible" during a protocol exchange.
	Protocol = 76

	// NoPerm indicates you did not have sufficient permission to perform the
	// operation.  This is not intended for file system problems, which should use
	// NoInput or CantCreate, but rather for higher level permissions.
	NoPerm = 77

	// Config indicates a configuration error.
	Config = 78

	MAX = 78 // maximum listed value
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ExitCode

type ExitCode int

func (ExitCode) String

func (ec ExitCode) String() string

Jump to

Keyboard shortcuts

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