retrysafe
← All rules

swallowed-error-returns-2xx

error

A catch block swallows a failure of the handler's work and still acknowledges the event (2xx, or a completed job).

Why it goes wrong

Retries are the provider's recovery mechanism. Answering 2xx after the work failed tells it the event was handled, so the event is never delivered again.

Safe pattern

Rethrow (or answer 5xx) when the work fails so the provider retries; only answer 2xx for duplicates or permanent payload errors you have recorded.

Configure

// retrysafe.config.ts
export default defineConfig({
  rules: { "swallowed-error-returns-2xx": "error" }, // or "off"
});

// or, for one line (a reason is required):
// retrysafe-ignore swallowed-error-returns-2xx -- <why this is safe>