A user-definable error-handling function
(*error* string)
If *error* is not nil, it is executed as a function whenever an AutoLISP error condition exists. AutoCAD passes one argument to *error*, which is a string containing a description of the error.
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.
This function does not return, except when using vl-exit-with-value.
The following function does the same thing that the AutoLISP standard error handler does. It prints the word “error,” followed by a description:
(defun *error* (msg)
(princ "error: ")
(princ msg)
(princ)
)
-
The vl-exit-with-error, vl-exit-with-value, vl-catch-all-apply, vl-catch-all-error-message, and vl-catch-all-error-p functions.