exit-codes-1.0.0: Exit codes as defined by BSD

Copyright(c) Justus Adam 2015 - 2018
LicenseBSD-3
Maintainerdev@justus.science
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

System.Exit.Codes

Contents

Description

These are Haskell values generated by the C pre processor which expose exit codes as defined by the BSD project in "sysexits.h".

Please note that the values shown in the documentation are also inserted by the preprocessor and thus technically only valid for the platform this documentation was built on.

As may be evident from the structure here both the integer value for the exit code as well as the ExitCode value (to be used with exitWith) are exposed.

The format for a given code is:

EX_ERRORNAME
Error code CPP macro as defined by the sysexits.h header
exErrorName
Int value for the error
codeErrorName
ExitCode value for the error

The documentation snippets I copied from https://www.freebsd.org/cgi/man.cgi?query=sysexits&apropos=0&sektion=0&manpath=FreeBSD+4.3-RELEASE&format=html.

Synopsis

Documentation

exOk :: Int #

successful termination (0)

The successful exit is always indicated by a status of 0, or exOk.

codeOk :: ExitCode #

successful termination (0)

exUsage :: Int #

command line usage error (64)

The command was used incorrectly, e.g., with the wrong number of arguments, a bad flag, a bad syntax in a parameter, or whatever.

codeUsage :: ExitCode #

command line usage error (64)

exDataErr :: Int #

data format error (65)

The input data was incorrect in some way. This should only be used for user's data and not system files.

codeDataErr :: ExitCode #

data format error (65)

exNoInput :: Int #

cannot open input (66)

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).

codeNoInput :: ExitCode #

cannot open input (66)

exNoUser :: Int #

addressee unknown (67)

The user specified did not exist. This might be used for mail addresses or remote logins.

codeNoUser :: ExitCode #

addressee unknown (67)

exNoHost :: Int #

host name unknown (68)

The host specified did not exist. This is used in mail addresses or network requests.

codeNoHost :: ExitCode #

host name unknown (68)

exUnavailable :: Int #

service unavailable (69)

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.

codeUnavaiable :: ExitCode #

service unavailable (69)

exSoftware :: Int #

internal software error (70)

An internal software error has been detected. This should be limited to non-operating system related errors as possible.

codeSoftware :: ExitCode #

internal software error (70)

exOsErr :: Int #

system error (71)

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.

codeOsErr :: ExitCode #

system error (71)

exOsFile :: Int #

critical OS file missing (72)

Some system file (e.g., etcpasswd, varrun/utmp, etc.) does not exist, cannot be opened, or has some sort of error (e.g., syntax error).

codeOsFile :: ExitCode #

critical OS file missing (72)

exCantCreate :: Int #

can't create (user) output file (73)

A (user specified) output file cannot be created.

codeCantCreate :: ExitCode #

can't create (user) output file (73)

exIOErr :: Int #

input/output error (74)

An error occurred while doing I/O on some file.

codeIOErr :: ExitCode #

input/output error (74)

exTempFail :: Int #

temp failure; user is invited to retry (75)

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.

codeTempFail :: ExitCode #

temp failure; user is invited to retry (75)

exProtocol :: Int #

remote error in protocol (76)

The remote system returned something that was "not possible" during a protocol exchange.

codeProtocol :: ExitCode #

remote error in protocol (76)

exNoPerm :: Int #

permission denied (77)

You did not have sufficient permission to perform the operation. This is not intended for file system problems, which should use exNoInput or exNoPerm, but rather for higher level permissions.

codeNoPerm :: ExitCode #

permission denied (77)

exConfig :: Int #

configuration error (78)

Something was found in an unconfigured or misconfigured state.

codeConfig :: ExitCode #

configuration error (78)

Bounds

exBase :: Int #

base value for error messages (64)

Error numbers begin at exBase to reduce the possibility of clashing with other exit statuses that random programs may already return.

exMax :: Int #

maximum listed value (78)