All Manuals > COM/Automation User Guide and Reference Manual > 4 Automation Reference Entries

get-error-info Function

Summary

Retrieves the error information for the current Automation method.

Package

com

Signature

get-error-info &key errorp fields => field-value*

Arguments
errorp
A boolean.
fields
A list of keywords specifying the error information fields to return.
Values
field-value*
Values corresponding to fields.
Description

The function get-error-info allows the various components of the error information to be retrieved for the last Automation method called. fields should be a list of the following keywords, to specify which fields of the error information should be returned:

:iid
A refguid object.
:source
A string specifying the ProgID.
:description
A string describing the error.
:help-file
A string giving the help file's path.
:help-context
An integer giving the help context id.

A field-value will be returned for each field specified. The field-value will be nil if the field is does not have a value.

If errorp is true and an error occurs while retrieving the error information, then an error of type com-error is signaled. Otherwise nil is returned.

Examples
(multiple-value-bind (source description)
    (get-error-info :fields '(:source :description))
  (error "Failed with '~A' in ~A" description source))
See also

set-error-info
call-dispatch-method
com-error


COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:41