Links
dtSearch Text Retrieval Engine Programmer's Reference
dtsErrorInfo Structure
Data Members | Classes | Legend | Members | Methods | Send Feedback

Used with dtsIndexJob and dtsSearchJob to record errors that occur during indexing or searching.

struct dtsErrorInfo {
  long structSize;
  void * pUserData;
};
File

dtsearch.h

Remarks

dtsErrorInfo accumulates messages in a buffer and has member functions to provide access to those messages. Additionally, it has a callback function you can use to obtain notifications each time a message is added to the dtsErrorInfo. dtsErrorInfo provides a more thread-friendly way to report errors than the global callback functions in the dtsInitInfo structure passed to dtssDoInit. 

For each message, the following information is recorded: (1) a numeric code, which identifies the message in a language-independent way; (2) the text of the message; and (3) up to two string arguments for the message. For example, if an index cannot be accessed in a search, the numeric code will be dtsErAccIndex, the text of the message will be "Unable to access index," the first argument will be the path to the index, and the second argument will be the reason the index could not be accessed. 

To use dtsErrorInfo, 

 

  1. Declare a dtsErrorInfo struct with the buffer size you want. (The constructor lets you specify the maximum number of messages and the total size of the string buffer.)
  2. Attach the dtsErrorInfo to the dtsSearchJob or dtsIndexJob as its errorHandler member.
  3. If you want to receive notifications when an error occurs, use the dtsErrorInfo's pNotifyFn member to designate the function to be called.
  4. Execute the dtsSearchJob or dtsIndexJob.
  5. After the job is complete, use the member functions described below to access information on the error conditions that occurred during the search.
  6. The dtsErrorInfo destructor will automatically delete the memory buffers allocated for the dtsErrorInfo. For information on error codes generated by the dtSearch Engine, see "Error Codes."

 

The data members of dtsErrorInfo (messageText, messageCode, etc.) should not be accessed directly. Instead, use the dtsErrorInfo constructor to initialize them and then use getCount(), getMessage(), etc. to access them.

Data Members
Data Member 
Description 
Use the pUserData pointer to store instance data that you want to access in the callback function in pNotifyFn. 
Initialize to sizeof(dtsErrorInfo). 
Group
Methods
Method 
Description 
Removes all messages from a dtsErrorInfo but does not deallocate the buffers. 
copy 
Copy all data from another dtsErrorInfo 
Constructor for dtsErrorInfo, which will allocate fixed-length buffers large enough to hold, by default, up to 20 messages with up to 4096 bytes. The dtsErrorInfo destructor will automatically deallocate these buffers. 
Transfer messages to another dtsErrorInfo 
Returns the number of messages logged in the dtsErrorInfo. 
Returns the text of a message 
Returns the numeric code of a message (see Error Codes for the values of these codes) 
Return text meaning for a numeric error code 
Adds a message to the dtsErrorInfo 
Returns true if some messages could not be stored in the dtsErrorInfo because the buffers were too small. 
Attaches a callback notification function to the dtsErrorInfo. Each time an error occurs during searching or indexing, the function provided will be called with a pointer to the dtsErrorInfo as the only parameter. Instance data can be accessed through the pUserData member of the dtsErrorInfo. 
Legend
 
Data Member 
 
Method 
Links
You are here: C++ API > Classes > dtsErrorInfo Structure
Copyright (c) 1995-2008 dtSearch Corp. All rights reserved.