Error Handling Overview

Meta Data Services Programming

Meta Data Services Programming

Error Handling Overview

If you are programming with COM interfaces, you can use interfaces to work with the error queue and handle errors. Equivalent functionality is not available to Automation objects. You cannot manage the error queue or its contents from an Automation object.

Error Handling

Error handling applies to methods on repository engine objects. In the repository API, COM interface members return an HRESULT return value that indicates whether a method completed successfully. If a repository interface member fails to complete successfully, an error object that contains details about the failure is created.

Error objects conform to the REPOSERROR data structure. For more information about the data structure of repository errors, see REPOSERROR Data Structure.

Error Queues

An error queue is a collection of error objects. Each repository instance maintains a single error queue. When an error is generated by a repository interface method, the error is added to the error queue of the current repository instance. If multiple errors occur as a result of a single member invocation, all of the errors are added to the error queue of the current repository instance.

You can have multiple repository instances and associated error queues active at one time. Multiple repository instances can be connected to the same repository database. Repository instances can originate from the same or from different processes. A single process can create multiple repository instances.

The repository error queue is a transient object; that is, the contents of the queue are valid only within the same operation in which the error occurred. Subsequent interactions with any repository object will automatically clear the error queue.

To work with the queue, use IRepositoryErrorQueueHandler to create an error queue, assign an error queue to a thread of execution, or retrieve an interface pointer to a thread's currently assigned error queue.

To manage errors within a queue, use IRepositoryErrorQueue for repository objects and IEnumRepositoryErrors enumeration objects.

See Also

Accessing Error Information at the COM Level

IEnumRepositoryErrors Interface

IRepositoryErrorQueue Interface

IRepositoryErrorQueueHandler Interface

Persisting Error Queue Information

Repository Class