<catch>

Exception catch block processor

Core v2.2.0

Overview

The processor executes only when an exception occurs in the preceding block. It provides access to error details via ${_error} variable and enables graceful error handling, logging, and recovery.

Usage Examples

Usage Examples

example-1.xml
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://org.webharvest/schema/2.1/core">
<try>
  <http url="https://unreliable-api.com/data"/>
</try>
<catch>
  <log message="API request failed: ${_error}"/>
  <var name="fallback_data">Default data</var>
</catch>
</config>

Parameters

Important Notes

Related Processors