{"version":"2.1.335","anchor":"plugin-on-catch-error-rule-changed","canonical_anchor":"plugin-on-catch-error-rule-changed","heading":"Plugin event .catch() must sit on the same statement as its on()","tier":"notice","area":"Plugins","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.335\/e\/plugin-on-catch-error-rule-changed","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.335","markdown":"### Plugin event `.catch()` must sit on the same statement as its `on()`\n\nPlugin code now gets an error if `.catch()` is attached after the event is set up, and must sit on the same statement as `on()`\n\n**Unclear.** It is not clear whether attaching `.catch()` after registration is now allowed where it was not before.\n\n**What**\n\nPlugins add features to Claude Code and can listen for events using `on()`. The error about attaching `.catch()`, which handles failures, has changed. It used to fire once registration had finished. It now fires when the event has already been set up, and says `.catch()` goes on the same statement as its `on()`.\n\n**Why**\n\nPlugin authors may see this different error and need to keep `.catch()` on the same line of code as the `on()` it belongs to.\n\n- Area: Plugins\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}