Action Pro since v1.4.0
fswa_glue_error
Fires when an assigned Code Glue snippet errors during a real dispatch (the delivery itself proceeds with the unmodified payload).
$
/ Signature
do_action( 'fswa_glue_error', $webhook_id, $trigger, $stage, $snippet_id, $error )
/ When it fires
A snippet error never breaks the delivery: the snippet runtime catches every Throwable, the payload falls back unmodified, and the error is written to the PHP error log. This hook fires at that moment so you can alert on broken glue instead of discovering it in the logs.
/ Parameters
| Name | In | Type | Req | Description |
|---|---|---|---|---|
| $webhook_id | param | int | yes | Webhook the snippet is assigned to. |
| $trigger | param | string | yes | Trigger being dispatched. |
| $stage | param | string | yes | `pre` (payload transform) or `post` (after the response). |
| $snippet_id | param | int | yes | The failing snippet’s ID. |
| $error | param | string | yes | The PHP error message, with the line number when known. |
/ Examples
Email the site admin when production glue starts failing
add_action( 'fswa_glue_error', function ( $webhook_id, $trigger, $stage, $snippet_id, $error ) { wp_mail( get_option( 'admin_email' ), sprintf( 'Code Glue error on webhook #%d', $webhook_id ), sprintf( "Snippet #%d (%s stage, trigger %s) failed:\n\n%s", $snippet_id, $stage, $trigger, $error ) ); }, 10, 5 );
/ Related
Ready Your next automation is
Your next automation is
one sentence away.
$ wp plugin install flowsystems-webhook-actions --activate