ERROR:
Factor documentation > Factor handbook > The language > Exception handling
Prev:ignore-errors ( quot -- )
Next:Restartable errors


Vocabulary
syntax

Syntax
ERROR: class slots... ;


Inputs and outputs
classa new tuple class to define
slotsa list of slot names


Word description
Defines a new tuple class whose class word throws a new instance of the error.

Notes
The following two snippets are equivalent:
ERROR: invalid-values x y ; TUPLE: invalid-values x y ; : invalid-values ( x y -- * ) \ invalid-values boa throw ;


Definition
USING: classes.tuple classes.tuple.parser kernel parser ;

IN: syntax

SYNTAX: ERROR:
parse-tuple-definition pick save-location
define-error-class ;