Indexing Pipeline Extension ActionOnError

Indexing pipeline extension script actionOnError value is defined in the source extension configuration (see Edit a Source JSON Configuration). This value sets an action in case the extension script times out or fails.

When adding an extension to a source, if you don’t set an actionOnError value, the default value is SKIP_EXTENSION.

actionOnError value Type Behavior when the extension script timeout or fail:
SKIP_EXTENSION

string

default

  • The item continues through the Document Processing Manager (see Document Processing Manager).
  • Future extension scripts still can be read and applied to the item.
REJECT_DOCUMENT string
  • The item doesn't continue through the DPM.
  • No future extension scripts can be read and applied to the item.
  • The item is deleted at the indexing stage.

When an extension script timeout or fail, whatever the actionOnError value is, the extension script isn’t applied to the item.

Consider the following extension script:

# identical script for myExtensionScript1 and myExtensionScript2
raise ValueError('this script always raises an error!')

The following JSON configuration contains two identical post conversion extensions with different name, extensionID and actionOnError values. The actionOnError value associated with myExtensionScript1 means that when an error is raised during the script execution, the extension script is skipped, the item continues through the DPM and future extension scripts can be read and applied to the item. Since the item continues through the DPM, myExtensionScript2 raises an error which leads to the item deletion at indexing stage.

{
   "common": {
     "preConversionExtensions": [],
     "postConversionExtensions": [
       {
         "condition": "",
         "extensionId": "myorganization-qdfs7z5nyw46ygfwg3lwzw2oei",
         "parameters": {},
         "versionId": "",
         "actionOnError": "SKIP_EXTENSION",
         "name": "myExtensionScript1"
       },
       {
         "condition": "",
         "extensionId": "myorganization-qsu6wwlpvzkv6wtr4ctg7pshue",
         "parameters": {},
         "versionId": "",
         "actionOnError": "REJECT_DOCUMENT",
         "name": "myExtensionScript2"
       }
     ]
   },
     "items": {}
}

Inverting the extension scripts order means that myExtensionScript2 prevents the item from going forward in the DPM as future extension scripts are ignored, ultimately leading to the item deletion at the indexing stage.

Recommended Articles