diffsol_c/error.rs
1// Convert diffsol errors to custom pydiffsol error type
2
3use diffsol::error::DiffsolError;
4use std::fmt;
5
6#[derive(Debug)]
7pub struct DiffsolRtError(DiffsolError);
8
9impl fmt::Display for DiffsolRtError {
10 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
11 write!(f, "{}", self.0)
12 }
13}
14
15impl std::error::Error for DiffsolRtError {}
16
17impl From<DiffsolError> for DiffsolRtError {
18 fn from(other: DiffsolError) -> Self {
19 DiffsolRtError(other)
20 }
21}