Copyright | (c) Justus Adam 2015 - 2018 |
---|---|
License | BSD-3 |
Maintainer | dev@justus.science |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
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
- exOk :: Int
- codeOk :: ExitCode
- exUsage :: Int
- codeUsage :: ExitCode
- exDataErr :: Int
- codeDataErr :: ExitCode
- exNoInput :: Int
- codeNoInput :: ExitCode
- exNoUser :: Int
- codeNoUser :: ExitCode
- exNoHost :: Int
- codeNoHost :: ExitCode
- exUnavailable :: Int
- codeUnavaiable :: ExitCode
- exSoftware :: Int
- codeSoftware :: ExitCode
- exOsErr :: Int
- codeOsErr :: ExitCode
- exOsFile :: Int
- codeOsFile :: ExitCode
- exCantCreate :: Int
- codeCantCreate :: ExitCode
- exIOErr :: Int
- codeIOErr :: ExitCode
- exTempFail :: Int
- codeTempFail :: ExitCode
- exProtocol :: Int
- codeProtocol :: ExitCode
- exNoPerm :: Int
- codeNoPerm :: ExitCode
- exConfig :: Int
- codeConfig :: ExitCode
- exBase :: Int
- exMax :: Int
Documentation
successful termination (0)
The successful exit is always indicated by a status of 0, or exOk
.
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.
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 Source #
data format error (65)
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 Source #
cannot open input (66)
addressee unknown (67)
The user specified did not exist. This might be used for mail addresses or remote logins.
codeNoUser :: ExitCode Source #
addressee unknown (67)
host name unknown (68)
The host specified did not exist. This is used in mail addresses or network requests.
codeNoHost :: ExitCode Source #
host name unknown (68)
exUnavailable :: Int Source #
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 Source #
service unavailable (69)
exSoftware :: Int Source #
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 Source #
internal software error (70)
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.
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 Source #
critical OS file missing (72)
exCantCreate :: Int Source #
can't create (user) output file (73)
A (user specified) output file cannot be created.
codeCantCreate :: ExitCode Source #
can't create (user) output file (73)
exTempFail :: Int Source #
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 Source #
temp failure; user is invited to retry (75)
exProtocol :: Int Source #
remote error in protocol (76)
The remote system returned something that was "not possible" during a protocol exchange.
codeProtocol :: ExitCode Source #
remote error in protocol (76)
codeNoPerm :: ExitCode Source #
permission denied (77)
configuration error (78)
Something was found in an unconfigured or misconfigured state.
codeConfig :: ExitCode Source #
configuration error (78)
Bounds
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.