Sets the error information for the current Automation method.
com
set-error-info &key iid source description help-file help-context => error-code
| iid⇩ | nil, a symbol naming a COM interface or a refguid foreign pointer. |
| source⇩ |
A string or nil. |
| description⇩ |
A string or nil. |
| help-file⇩ |
A string or nil. |
| help-context⇩ |
An integer or nil. |
| error-code |
The error code DISP_E_EXCEPTION or nil if the error info could not be set. |
The function set-error-info allows the various components of the error information to be set for the current Automation method. It should only be called within the dynamic scope of the body of a define-com-method definition. The value DISP_E_EXCEPTION can be returned as the hresult of the method to indicate failure.
If iid is non-nil, it is set as IID of the interface that defined the error, or nil if none.
If source is non-nil, it is set as the ProgID for the class that raised the error.
If description is non-nil, it is set as the textual description of the error.
If help-file is non-nil, it is set as the path of the help file that describes the error.
If help-context is non-nil, it is set as the help context id for the error.
(define-com-method (i-robot rotate)
((this i-robot-impl)
(axis :in)
(angle-delta :in))
(let ((joint (find-joint axis)))
(if joint
(progn
(rotate-joint joint)
S_OK)
(set-error-info :iid 'i-robot
:description "Bad joint."))))
COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:41