9 Exception utilities
Utilities for raising and handling exceptions.
(raise-exn id message arg ...) |
Raises an exception with a default set of continuation marks.
id is the identifier of the exception’s structure type transformer binding (e.g.
exn or
exn:fail).
message and
args are passed to the exception’s constructor, along with the value of
current-continuation-marks.
Examples: |
|
#(struct:exn:fail | "Oops!" | #<continuation-mark-set>) |
|
|
#(struct:exn:fail:syntax | "Oops!" | #<continuation-mark-set> | (#<syntax:3:0> | #<syntax:3:0> | #<syntax:3:0>)) |
|
(reraise-exn old-exn new-exn new-message arg ...) |
Raises new-exn with a message of:
and the same continuation marks as old-exn. Any additional args are passed to the constructor of new-exn.
Example: |
|
#(struct:exn:fail | "Looks serious: Oops!" | #<continuation-mark-set>) |
|