Skip to content

Commit

Permalink
Implement Error for SolverError
Browse files Browse the repository at this point in the history
  • Loading branch information
Andlon committed Jul 12, 2023
1 parent ebf75c5 commit 25dbe23
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/dss/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,14 @@ impl Display for SolverError {
}
}

impl std::error::Error for SolverError {
fn cause(&self) -> Option<&dyn std::error::Error> {
match self {
SolverError::DefineStructure(err) | SolverError::Reorder(err) | SolverError::Factor(err) | SolverError::Solve(err) | SolverError::OtherMklRoutine(err) => Some(err),
}
}
}

pub struct Solver<T> {
handle: Handle,
marker: PhantomData<T>,
Expand Down

0 comments on commit 25dbe23

Please sign in to comment.