errors
HwpApiError and subclasses.
errors.HwpApiError
errors.HwpApiError()Base for every hwpapi-raised exception.
errors.ConnectionError
errors.ConnectionError()Raised when the HWP COM object can’t be dispatched or has died.
errors.ActionFailedError
errors.ActionFailedError()Raised when HAction.Run / HAction.Execute returns falsy.
errors.InvalidArgumentError
errors.InvalidArgumentError()Raised for unknown formats, malformed paths, or bad kwargs.
errors.FileIOError
errors.FileIOError()Raised when an open/save/export fails at the filesystem/COM edge.
errors.wrap_com_error
errors.wrap_com_error(action_name)Re-raise COM errors inside the block as :class:ActionFailedError.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| action_name | str | Short label for the failing operation — included in the error message so callers can tell FileOpen from FileSaveAsPdf. |
required |
Example
with wrap_com_error(“FileOpen”): … app.api.Open(path)