ra-errors

1.0.0

Philipp Schafft <lion@lion.leolix.org>

This version online. Latest stable version online. Latest draft online.

Abstract

The RoarAudio error codes define a set of portable and transferable error codes. They can be used both within software as well as used to transmit reasons for errors over the network. Copyright (C) 2011-2021 Philipp Schafft <lion@lion.leolix.org> All rights reserved.

Requirements Language

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

Definition

This specification defines a set of error codes. Each code has a name, and a value (sometimes also called ID). Additionally this specification also defines a default text for the error.

Name

The name is defines as a short uppercase string. It's main use is for defining constants in libraries, and programs.

Value

The value is a integer number that is greater than or equal to -1. Implementations at least support a range of [-1 to 65534] (inclusive). Implementations that transfer the code MAY implement it as an unsigned integer and represent -1 as all bits set. At least 16 bit are required in this case. Values -2 and less are reserved for implementation internal use. Those can be used freely by the application. However those values MUST NOT be transfered to other applications. Implementations that receive such a error code MUST reject it. This MAY be done by replacing it with error code -1 (UNKNOWN).

Reserved values

The values 256, and (by implementations supporting codes greater 65534) also 65535, 16777215, 4294967295, and 18446744073709551615 are reserved.

Values 0, and -1

The value 0 (NONE) is used to indicate that the operation succeeded. The value -1 (UNKNOWN) is used to indicate that the operation failed and no other code could be returned.

Code definition

The followint tables are all machine readable. Data is prefixed with a special sequence for extracting. Fields are seperated by at least two spaces.

Codes

Name Code Default text

@C UNKNOWN -1 Unknown (maybe no) error @C NONE 0 No error @C PERM 1 Operation not permitted @C NOENT 2 No such file or directory @C BADMSG 3 Bad message @C BUSY 4 Device or resource busy @C CONNREFUSED 5 Connection refused @C NOSYS 6 Function not implemented @C NOTSUP 7 Operation not supported @C PIPE 8 Broken pipe @C PROTO 9 Protocol error @C RANGE 10 Result too large/general out of range @C MSGSIZE 11 Message too long @C NOMEM 12 Not enough space @C INVAL 13 Invalid argument @C ALREADY 14 Connection already in progress @C BADRQC 15 Invalid request code @C DOM 16 Mathematics argument out of domain of function @C EXIST 17 File or object exists @C FAULT 18 Bad address @C IO 19 I/O-Error @C KEYEXPIRED 20 Key has expired @C KEYREJECTED 21 Key was rejected by service @C LOOP 22 Too many recursions @C MFILE 23 Too many open files or objects @C NAMETOOLONG 24 File or object name too long @C NODATA 25 No message is available on the read queue @C NODEV 26 No such device @C NODRV 27 No such driver @C NOSPC 38 No space left on device @C TYPEMM 39 Type missmatch. Object of diffrent type required @C NORSYS 40 Feature not implemented by remote end @C NOTCONN 41 Socket or object not connected @C PROTONOSUP 42 Protocol not supported @C RIO 43 Remote I/O Error @C RO 45 File or object is read only @C TIMEDOUT 46 Connection timed out @C AGAIN 47 Resource temporarily unavailable @C NOISE 48 Line too noisy @C LINKDOWN 49 Physical or logical link down @C INTERRUPTED 50 Operation was interruped @C CAUSALITY 51 Causality error @C QUOTA 52 Quota exceeded @C BADLIB 53 Accessing a corrupted shared library @C NOMEDIUM 54 No medium found @C NOTUNIQ 55 Name not unique @C ILLSEQ 56 Illegal byte sequence @C ADDRINUSE 57 Address in use @C HOLE 58 Hole in data @C BADVERSION 59 Bad version @C NSVERSION 60 Not supported version @C BADMAGIC 61 Bad magic number @C LOSTSYNC 62 Lost synchronization @C BADSEEK 63 Can not seek to destination position @C NOSEEK 64 Seeking not supported on resource @C BADCKSUM 65 Data integrity error @C NOHORSE 66 Mount failed @C CHERNOBYL 67 Fatal device error @C NOHUG 68 Device needs love @C TEXTBUSY 69 Text file busy @C NOTEMPTY 70 Directory not empty @C NODEUNREACH 71 Node is unreachable @C IDREMOVED 72 Identifier removed @C INPROGRESS 73 Operation in progress @C NOCHILD 74 No child processes/object @C NETUNREACH 75 Network unreachable @C CANCELED 76 Operation canceled @C ISDIR 77 Is a directory @C NOTDIR 78 Not a directory @C BADEXEC 79 Executable file format error @C ISCONN 80 Socket/Object? is connected @C DEADLOCK 81 Resource deadlock would occur @C CONNRST 82 Connection reset @C BADFH 83 Bad file handle @C NOTSOCK 84 Not a socket @C TOOMANYARGS 85 Argument list too long @C TOOLARGE 86 File/Object? too large @C DESTADDRREQ 87 Destination address required @C AFNOTSUP 88 Address family not supported @C NOPOWER 89 Operation can not be completed because we are low on power @C USER 90 Error in front of screen @C NFILE 91 Too many files/objects open in system @C STALE 92 Stale file handle or object @C XDEVLINK 93 Cross-device link @C MLINK 94 Too many links to file or object @C NONET 95 Not connected to any network @C CONNRSTNET 96 Connection reset by network @C CONNABORTED 97 Connection aborted @C BADHOST 98 Bad host software or hardware @C SWITCHPROTO 99 Switch protocol @C MOVEDPERM 100 Moved Permanently @C MOVEDTEMP 101 Moved Temporary @C USEPROXY 102 Use Proxy server @C SEEOTHER 103 See other resource @C GONE 104 Resource gone @C BADLICENSE 105 Bad License @C NEEDPAYMENT 106 Payment Required @C NSTYPE 107 Type or Format not supported @C CENSORED 108 Access denied because of censorship @C BADSTATE 109 Object is in bad/wrong state @C DISABLED 110 This has been disabled by the administrator

Mapping to errno

Informal section This section might be incomplete.

Name Code errno

@E PERM 1 EPERM @E NOENT 2 ENOENT @E BADMSG 3 EBADMSG @E BUSY 4 EBUSY @E CONNREFUSED 5 ECONNREFUSED @E NOSYS 6 ENOSYS @E NOTSUP 7 ENOTSUP @E PIPE 8 EPIPE @E PROTO 9 EPROTO @E RANGE 10 ERANGE @E MSGSIZE 11 EMSGSIZE @E NOMEM 12 ENOMEM @E INVAL 13 EINVAL @E ALREADY 14 EALREADY @E BADRQC 15 EBADRQC @E DOM 16 EDOM @E EXIST 17 EEXIST @E FAULT 18 EFAULT @E IO 19 EIO @E KEYEXPIRED 20 EKEYEXPIRED @E KEYREJECTED 21 EKEYREJECTED @E LOOP 22 ELOOP @E MFILE 23 EMFILE @E NAMETOOLONG 24 ENAMETOOLONG @E NODATA 25 ENODATA @E NODEV 26 ENODEV @E NOSPC 38 ENOSPC @E NOTCONN 41 ENOTCONN @E PROTONOSUP 42 EPROTONOSUPPORT @E RIO 43 EREMOTEIO @E RO 45 EROFS @E TIMEDOUT 46 ETIMEDOUT @E AGAIN 47 EAGAIN @E INTERRUPTED 50 EINTR @E QUOTA 52 EDQUOT @E BADLIB 53 ELIBBAD @E NOMEDIUM 54 ENOMEDIUM @E NOTUNIQ 55 ENOTUNIQ @E ILLSEQ 56 EILSEQ @E ADDRINUSE 57 EADDRINUSE @E BADSEEK 63 ESPIPE @E TEXTBUSY 69 ETXTBSY @E NOTEMPTY 70 ENOTEMPTY @E NODEUNREACH 71 EHOSTUNREACH @E IDREMOVED 72 EIDRM @E INPROGRESS 73 EINPROGRESS @E NOCHILD 74 ECHILD @E NETUNREACH 75 ENETUNREACH @E CANCELED 76 ECANCELED @E ISDIR 77 EISDIR @E NOTDIR 78 ENOTDIR @E BADEXEC 79 ENOEXEC @E ISCONN 80 EISCONN @E DEADLOCK 81 EDEADLK @E CONNRST 82 ECONNRESET @E BADFH 83 EBADF @E NOTSOCK 84 ENOTSOCK @E TOOMANYARGS 85 E2BIG @E TOOLARGE 86 EFBIG @E DESTADDRREQ 87 EDESTADDRREQ @E AFNOTSUP 88 EAFNOSUPPORT @E NFILE 91 ENFILE @E STALE 92 ESTALE @E XDEVLINK 93 EXDEV @E MLINK 94 EMLINK @E NONET 95 ENONET @E CONNRSTNET 96 ENETRESET @E CONNABORTED 97 ECONNABORTED @E BADSTATE 109 EBADFD

Mapping to HTTP status codes

Informal section This section might be incomplete.

Name Code HTTP

@H NONE 0 200 OK @H NOENT 2 404 File not found @H NEEDPAYMENT 106 402 Payment Required @H NSTYPE 107 415 Unsupported Media Type @H CENSORED 108 450 Blocked by Windows Parental Controls, 451 Unavailable For Legal Reasons (Internet draft)