Action since v1.0.0
fswa_error
Fires after a webhook delivery fails — covers both HTTP error responses and transport errors.
$
/ Signature
do_action( 'fswa_error', $trigger, $url, $payload, $response, $attempt )
/ When it fires
Fires on every failed delivery attempt — 4xx, 5xx, and transport errors (connection refused, timeout, SSL). Fires before the retry decision is made.
/ Parameters
| Name | In | Type | Req | Description |
|---|---|---|---|---|
| $trigger | param | string | yes | WordPress action name. |
| $url | param | string | yes | Endpoint URL. |
| $payload | param | array | yes | The payload that was sent. |
| $response | param | array|WP_Error | yes | `wp_remote_post()` response or a `WP_Error` for transport failures. |
| $attempt | param | int | — | Current attempt number (1-based). |
/ Examples
Alert on permanently failed deliveries
add_action( 'fswa_error', function ( $trigger, $url, $payload, $response, $attempt ) { if ( is_wp_error( $response ) ) { $message = $response->get_error_message(); } else { $code = wp_remote_retrieve_response_code( $response ); $message = "HTTP {$code}"; } error_log( "[fswa] Failed attempt {$attempt}: {$trigger} → {$url} ({$message})" ); }, 10, 5 );
/ Related
Ready Stop losing webhooks.
Stop losing webhooks.
Start logging them.
$ wp plugin install flowsystems-webhook-actions --activate