An exception thrown by an event handler is not passed to the index: the other handlers of the event are called, the operation that raised the event continues, and the exception is written to the log of the index (see Logger). An exception of a handler of an event of an IndexRepository is written to the log of the index that raised the event; if the event is raised by the repository itself, the exception is not logged.
The example demonstrates a typical usage of the class.
stringindexFolder=@"c:\MyIndex\";stringdocumentsFolder=@"c:\MyDocuments\";stringquery="Einstein";// Creating an indexIndexindex=newIndex(indexFolder);// Subscribing to the eventindex.Events.ErrorOccurred+=(sender,args)=>{Console.WriteLine(args.Message);};// Indexing documents from the specified folderindex.Add(documentsFolder);// Searching in the indexSearchResultresult=index.Search(query);