Skip to main content

classify_exit

Function classify_exit 

Source
pub fn classify_exit(err: &Error) -> i32
Expand description

Map an error to its process exit code per the ExitClass taxonomy.

Precedence (first match wins):

  1. SchemaDriftError downcast → 4.
  2. DataIntegrityError or crate::manifest::ManifestInconsistency downcast → 3.
  3. otherwise, if [crate::pipeline::retry::classify_error] says the error is transient → 2.
  4. otherwise → 1 (generic).

§Why a string bridge for the aggregated run path

The single-export apply path returns the typed marker straight to main, so the downcasts below fire directly. The multi-export run path used to flatten per-export failures into a Vec<String> and re-raise a fresh anyhow!, erasing the concrete type — which once forced a substring bridge here. pipeline::run now carries a representative typed failure instead (the most stop-worthy class among the failures), so the marker survives and the downcasts work for rivet run too. Classification is therefore purely type-driven: an un-typed data-integrity / drift failure classifies as Generic on purpose — a visible signal that a marker was dropped upstream, rather than being silently rescued by string matching.