2026-05-08 19:07:01 +08:00

31 lines
994 B
Rust

use std::path::PathBuf;
use macros::traceable;
traceable! {
MLError {
#[no_source]
#[error("Initialize Machine Learning detection failed")]
InitializeFailed => tracing::Level::ERROR,
#[no_source]
#[error("Failed to load ONNX model from: {path:?}")]
ModelLoadFailed { path: PathBuf } => tracing::Level::ERROR,
#[no_source]
#[error("Failed to load inference configuration from: {path:?}")]
ConfigLoadFailed { path: PathBuf } => tracing::Level::ERROR,
#[no_source]
#[error("Failed to parse inference configuration: {reason}")]
ConfigParseFailed { reason: String } => tracing::Level::ERROR,
#[no_source]
#[error("Tracker mutex poisoned; skipping operation")]
TrackerLockPoisoned => tracing::Level::ERROR,
#[no_source]
#[error("Inference flow buffers mutex poisoned; skipping operation")]
InferenceLockPoisoned => tracing::Level::ERROR,
}
}