Proposal for next iteration of foreign error accessors
Lassi Kortela 27 Jul 2020 09:07 UTC
(foreign-error:set ferr) -> symbol or #f ; error-set
(foreign-error:code ferr) -> exact integer or symbol or #f
(foreign-error:mnemonic ferr) -> symbol or #f
(foreign-error:message ferr [language [country]]) -> string or #f
(foreign-error:message-locales ferr) -> list of (language . country) pairs
(foreign-error:data ferr [key [args...]]) -> object or #f
(foreign-error:data-keys ferr) -> list of symbols
(foreign-error:call ferr) -> (symbol . arguments) or #f ;
Scheme side
(foreign-error:foreign-call ferr) -> (symbol . arguments) or #f ;
C/network side
Suggested data keys for things that are common but not ubiquitous:
'facility symbol
'severity symbol
'message-detail string
'message-hint string
'class-code symbol or exact integer
'class-title string
'filename string
'line-number positive exact integer
'column-number positive exact integer
'sqlstate symbol (or is string better?)