*pop-error-mode* (AutoLISP)

Error-handling function that ends the previous call to *push-error-using-command* or *push-error-using-stack*

Supported Platforms: Windows and Mac OS

Signature

(*pop-error-mode*)

No arguments.

Return Values

Type: T

A value of T is returned.

Remarks

A call to *pop-error-mode* should be made after replacing a custom *error* handler function with the previously defined *error* handler.

Note: This function is not required when using the command-s function in an *error* handler.

Examples

The following example demonstrates the use of the *pop-error-mode* function.

(defun my_err (err_msg)
    (if (/= err_msg "Function cancelled")
      (prompt (strcat "\nError: " err_msg))
    )
    (command "._undo" "_e")
    (command "._U")
    (setq *error* olderr)
  (princ)
)

(defun myUtil (key / )
    (setq olderr *error*
          *error* my_err)
    (*push-error-using-command*)         ; Indicate use of the command function instead of command-s
                                         ; in a custom error handler

    (command "._undo" "_group")          ; The following will not be executed in this sample, but is good 
                                         ; framework for setting up your own error handlers
  
    (/ 1 0)                              ; Call a function with incorrect values to trigger the custom error handler
                                         ; Remove when setting up your code
   
    ;; Perform your tasks here

    (command "._undo" "_e")
    (setq *error* olderr)                ; Restore old *error* handler
    (*pop-error-mode*)                   ; End the use of *push-error-using-command*
)

After loading the sample code, enter (myutil “String”) at the Command prompt to enter the error handler.