MCPcopy Create free account
hub / github.com/SeismicSystems/summit / handle_db_error

Method handle_db_error

finalizer/src/db.rs:51–56  ·  view source on GitHub ↗

Log a database error and initiate graceful shutdown.

(&self, e: impl std::fmt::Display, op: &str)

Source from the content-addressed store, hash-verified

49
50 /// Log a database error, initiate graceful shutdown, and return the error so callers
51 /// can propagate it and fence any consensus-critical side effects that must not run on
52 /// state that failed to persist.
53 fn handle_db_error(&self, e: impl std::fmt::Display, op: &str) -> anyhow::Error {
54 error!(target: "critical", %e, op, "fatal database error, initiating shutdown");
55 #[cfg(feature = "prom")]
56 metrics::counter!("critical_errors_total", "reason" => "fatal_db_error", "severity" => "critical").increment(1);
57 self.cancellation_token.cancel();
58 anyhow::anyhow!("fatal database error in {op}: {e}")
59 }

Calls

no outgoing calls

Tested by

no test coverage detected