Skip to content
TurtleKitty edited this page May 12, 2019 · 3 revisions

error

This procedure calls the current error handler with an error object consisting of a name, form, and message.

(error <name> <form> <message>)

is equivalent to

(fail
    (object 'type error
            'name <name>
            'form <form>
            'message <message>
            'to-text <message>))
(error 'not-found %(foo bar baz) "Missing item!")
    ; #(error not-found (foo bar baz) "Missing item!")

Most procedures in the global prelude use this rather than the more primitive fail. fail is useful when an error handler wants to pass an error to a higher handler untouched.

Clone this wiki locally