# Failure handlers
Source: https://www.inngest.com/docs/features/inngest-functions/error-retries/failure-handlers

If your function exhausts all of its retries, it will be marked as "Failed." You can handle this circumstance by either providing an [`onFailure/on_failure`](/docs/reference/functions/handling-failures) handler when defining your function, or by listening for the [`inngest/function.failed`](/docs/reference/system-events/inngest-function-failed) system event.

The first approach is function-specific, while the second covers all function failures in a given Inngest environment.