AquaLogic User Interaction Development Guide

     Previous Next  Open TOC in new window   View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Handling Exceptions in Custom Content Crawlers

Content crawler code should handle exceptions.

Most calls should be put into a try-catch block. The scope of the try-catch block should be small enough to diagnose errors easily.

In the catch block, log the error in both Log4j/Log4net as well as ICrawlerLog and then re-throw the exception as a ServiceException. This will result in the error displaying in the job log. However, only the error message shows up in the log; look at the log from Log4j/Log4net to get the full stack trace. The following exceptions have special meaning:


  • NotInitializedException means to re-initialize.
  • NoLongerExistsException means that the folder or document no longer exists, and tells the portal to delete that resource.

If any exception is thrown during the initial AttachToContainer, the crawl aborts. If NotInitializedException is thrown, the content crawler re-initializes. If NoLongerExistsException is thrown, the resource is removed from the Knowledge Directory, and the content crawler continues to the next resource. If other exceptions are thrown, the error is logged, and the content crawler continues to the next resource.

To use ICrawlerLog, store the member variable in your implementation of IContainerProvider.Initialize. To send a log message, simply add the following line: m_logger.Log('enter logging message here')

Note: The container provider log reads the logs only after AttachToContainer and after exceptions. The document provider log reads only after exceptions. For more information and the best visibility, use Log4j/Log4net.

For details on logging, see About ALI Logging Utilities.


  Back to Top      Previous Next