Registry of known foreign error collections
Lassi Kortela 27 Jul 2020 07:45 UTC
Error collections mentioned in the SRFI so far:
'errno POSIX errnos
'postgresql PostgreSQL errors
'libsodium The libsodium cryptography library
As John mentioned earlier, errno originates from the C language itself,
and is defined in the ISO/ANSI C standard. POSIX tracks that standard
and POSIX errno values are a superset of C errno values. Particular
Unix-like OSes further extend the POSIX set of errno identifiers with
some new ones (and occasionally omit some POSIX ones).
Hence 'errno is a good symbol (accurately mirrors the vagueness of the
underlying C variable as to where each error identifier comes from: C,
POSIX, non-POSIX Unix heritage, or OS-specific). The description could
be something similarly vague like "C/POSIX/Unix errno values".
Arthur, could we keep a growing list of known error-set identifiers in
the SRFI's repo? The list could also go into a file in
<https://github.com/srfi-explorations/identifiers> which hosts the list
of Scheme implementation ID's I've been collecting based on the
cond-expand identifiers used by each implementation.
Here are some more:
'ftp File Transfer Protocol reply codes
'http Hypertext Transfer Protocol status codes
'mysql MySQL and MariaDB database errors
'sqlite SQLite database result codes
And usage examples:
(foreign-error:error-set ferr) -> 'ftp
(foreign-error:code ferr) -> 504
(foreign-error:message ferr) -> "Command not implemented for that parameter"
(foreign-error:error-set ferr) -> 'http
(foreign-error:code ferr) -> 404
(foreign-error:message ferr) -> "Not Found"
(foreign-error:error-set ferr) -> 'mysql
(foreign-error:code ferr) -> 1005
(foreign-error:symbol ferr) -> 'ER_CANT_CREATE_TABLE
(foreign-error:message ferr) -> "Can't create table '%s' (errno: %d)"
(foreign-error:error-set ferr) -> 'sqlite
(foreign-error:code ferr) -> 6
(foreign-error:symbol ferr) -> 'SQLITE_LOCKED
(foreign-error:message ferr) -> "A table in the database is locked"