Skip to main content

run_failure

Telling the pod hooks that a background run failed or was held back.

Shared by the run itself (flows.dag.deployment), which reports a failure it hit, and the pod (flows.dag.background_handler), which reports a run it held back before submitting. Both reach the desktop app through the same hook. A held-back run is reported under its own error code, so the app can show it as paused rather than as failed.

Module​

Functions​

report_run_failure​

def report_run_failure(    exc: Exception,    *,    project_id: str,    datasource_name: str,    trigger: str,    error_code: str | None = None,) ‑> None:

Tell the registered pod hooks that a background run failed.

A background run has nobody watching, so without this a failure leaves nothing but the log lines of the process it happened in. Never raises: a hook that cannot be reached must not replace the real failure.

Arguments

  • exc: What the run failed with.
  • project_id: Project the datasource is linked to.
  • datasource_name: Datasource the run was processing.
  • trigger: Why the run was started, as a BackgroundTrigger value.
  • error_code: The stable code to report under, for a caller that knows it, such as the pod reporting a run it held back. None takes the code of the first PermanentError in exc's chain, if any.