5.3.2
8 Errors
Raises an exception with a message composed according to the Racket
error
message convention. The exception is created with
constructor, which is
exn:fail by default.
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
'value formats the value using
error-value->string-handler; the detail line is not omittable
unless 'maybe or 'multi is also provided
Examples: |
> (raise-misc-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 | > (raise-misc-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 | > (raise-misc-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 |
|