7 Errors
(require unstable/error) | package: unstable-lib |
procedure
(error* name message field value ... ... [ #:continued continued-message]) → any name : symbol? message : string?
field :
(let ([option/c (or/c 'value 'multi 'maybe)]) (or/c string? (cons/c string? (listof option/c)))) value : any/c continued-message : (or/c string? (listof string?)) = null
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
> (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
procedure
(raise-syntax-error* message expr sub-expr field value ... ... [ #:continued continued-message]) → any message : string? expr : (or/c syntax? #f) sub-expr : (or/c syntax? #f)
field :
(let ([option/c (or/c 'value 'multi 'maybe)]) (or/c string? (cons/c string? (listof option/c)))) value : any/c continued-message : (or/c string? (listof string?)) = null
procedure
(compose-error-message name message field value ... ... [ #:continued continued-message]) → string? name : (or/c symbol? #f) message : string?
field :
(let ([option/c (or/c 'value 'multi 'maybe)]) (or/c string? (cons/c string? (listof option/c)))) value : any/c continued-message : (or/c string? (listof string?)) = null
procedure
(compose-error-detail field options value) → string?
field : string? options : (listof (or/c 'value 'multi 'maybe)) value : any/c
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.
procedure
(exn:not-break? x) → boolean?
x : any/c
procedure
(error-display x) → void?
x : any/c