1use lc_providers::ProviderError;
4
5#[derive(Debug, thiserror::Error)]
10#[non_exhaustive]
11pub enum TestkitError {
12 #[error("io error while recording/replaying: {0}")]
14 Io(#[from] std::io::Error),
15 #[error("replay queue exhausted (requested {requested} messages, no recording left)")]
17 ReplayExhausted { requested: usize },
18 #[error("replay has no recording matching request messages (strategy=Exact, {left} exchange(s) left)")]
21 ReplayNoMatch { left: usize },
22 #[error("inner model error: {0}")]
24 Inner(#[from] ProviderError),
25}
26
27impl From<TestkitError> for ProviderError {
28 fn from(e: TestkitError) -> Self {
29 match e {
30 TestkitError::Inner(p) => p,
32 other => other.to_string().into(),
34 }
35 }
36}