You are here: C++ API > Variables > dtsDefaultMaxErrorInfoSize Variable
dtSearch Text Retrieval Engine Programmer's Reference
dtsDefaultMaxErrorInfoSize Variable

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

File: dtsearch.h

const int dtsDefaultMaxErrorInfoSize = 8192;

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.

Copyright (c) 1995-2021 dtSearch Corp. All rights reserved.