*error* (AutoLISP)

A user-definable error-handling function

Supported Platforms: Windows and Mac OS

Signature

(*error* string)
string

Type: String

A textual string that contains a description of the error and is passed by AutoCAD.

Return Values

Type: N/A

This function does not return, except when using vl-exit-with-value.

Remarks

If *error* is not nil, it is executed as a function whenever an AutoLISP error condition exists.

Your *error* function can include calls to the command function without arguments (for example, (command)). This will cancel a previous AutoCAD command called with the command function.

Examples

The following function does the same thing that the AutoLISP standard error handler does. It prints the text “error: ” followed by a description:

(defun *error* (msg)
  (princ "error: ")
  (princ msg)
 (princ)
)