systemprompt_database/resilience/error.rs
1//! The error type the resilience layer itself produces.
2
3use std::time::Duration;
4
5#[derive(Debug, thiserror::Error)]
6pub enum ResilienceError<E> {
7 #[error("circuit breaker '{key}' is open; failing fast")]
8 CircuitOpen { key: String },
9
10 #[error("bulkhead '{key}' is saturated ({limit} concurrent permits in use)")]
11 BulkheadFull { key: String, limit: usize },
12
13 #[error("operation timed out after {after:?}")]
14 Timeout { after: Duration },
15
16 #[error(transparent)]
17 Inner(#[from] E),
18}