ERROR
Syntax CATCH "ERROR
 
Explanation ERROR is the error object used by the error handling mechanism. See also CATCH and THROW.

When you catch an error, the system variable ERROR contains a short word describing the error that occured. This variable is only set when a procedure is running. At toplevel, the variable contains the empty list []. Use these values to throw certain types of runtime errors.
 

SYNTAX Syntax error
BREAK The user clicked the yellow light
STOP The user clicked the red light. Same as TOPLEVEL, but prints the message Stopped!
TOPLEVEL Thrown by the TOPLEVEL command; returns to toplevel.
ACCESS A name or a procedure does not exist
CONVERSION Data conversion error
INPUT Missing inputs to a procedure
OUTPUT A procedure did not output anything
RESULT Unexpected result
BADPROC Malformed procedure definition
BADFORMAL Bad formal argument list
RUNTIME General runtime error
NAME A name is already being used
RECURSION Too many active procedures
MATH Math error
IO I/O error
COMMAND This command is only valid at toplevel
COMPONENT A component is outside the window

The system variable ERRORTEXT contains the text which Logo would otherwise have printed. This variable is only set when a procedure is running. At toplevel, the variable contains the empty list [].
 

Examples HELLO 
HELLO is neither a procedure nor a name
TO CATCH.ERROR
     CATCH "ERROR [HELLO]
     PRINT LIST "|Code: | :ERROR
     PRINT LIST "|Text: | :ERRORTEXT
END
CATCH.ERROR defined.

CATCH.ERROR
Code: ACCESS
Text: HELLO is neither a procedure nor a name

TopIndex