hydra_engine_wds/analysis/
errors.rs1#[derive(Debug)]
3pub enum AnalysisComputeError {
4 NoSnapshots,
6 Session(crate::simulation::SessionError),
8 OutRead(String),
10 InvalidInput(String),
12}
13
14impl std::fmt::Display for AnalysisComputeError {
15 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
16 match self {
17 Self::NoSnapshots => write!(f, "simulation has no snapshots"),
18 Self::Session(e) => write!(f, "failed to read simulation results: {e}"),
19 Self::OutRead(e) => write!(f, "failed to read output file: {e}"),
20 Self::InvalidInput(e) => write!(f, "invalid analysis input: {e}"),
21 }
22 }
23}
24
25impl std::error::Error for AnalysisComputeError {}
26
27impl From<crate::simulation::SessionError> for AnalysisComputeError {
28 fn from(value: crate::simulation::SessionError) -> Self {
29 Self::Session(value)
30 }
31}