6.1.1
8 Errors
The composed error message includes details consisting of the
alternating field and value arguments. By default,
value is formatted as if by display unless it is
#f, in which case the detail line is omitted. The following
options affect the formatting of the detail line:
'multi formats each element in the corresponding value,
which must be a list, as a separate line; if 'maybe is also provided,
then the detail line is omitted if the list is empty
'value formats the value using
error-value->string-handler; the detail line is not omittable
unless 'maybe or 'multi is also provided
Examples: |
| > (error* 'mcbean "too many stars upon thars" | | '("given" value) 'star-bellied-sneetch | | '("stars" value) 3) |
| mcbean: too many stars upon thars | given: 'star-bellied-sneetch | stars: 3 | | > (error* 'hal "unable to open pod bay doors" | | #:continued "this mission is too important to let you jeopardize it" | | "threat" "David Bowman" | | "detection" "lip reading") |
| hal: unable to open pod bay doors; | this mission is too important to let you jeopardize it | threat: David Bowman | detection: lip reading | | > (error* 'car "missing car keys" | | '("searched" multi) | | (list "dresser" "desk" "kitchen table" "under sofa" | | "behind microwave" "in washing machine") | | "last seen" | | #f) |
| car: missing car keys | searched: | dresser | desk | kitchen table | under sofa | behind microwave | in washing machine |
|
Formats a single detail for an error message. The
options
behave as described in
error*.
The resulting string begins with a newline unless it is empty, so it
can be appended to the end of a base error message.
The subsequent bindings were added by Jay McCarthy.