Skip to content

Commit

Permalink
Throw NotSupported instead of InvalidInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
gskorokhod committed Jan 26, 2024
1 parent daa4f0f commit ac6a5df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,10 @@ fabric.properties

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

# IDEA config files - idk if we actually need these?
.idea/vcs.xml
.idea/misc.xml
.idea/inspectionProfiles
.idea/.gitignore
.idea/conjure-oxide.iml
6 changes: 2 additions & 4 deletions conjure_oxide/src/solvers/kissat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,8 @@ impl FromConjureModel for CNF {
match ans.add_expression(&expr) {
Ok(_) => {}
Err(error) => {
let message = format!("Error converting to CNF: {:?}", error);
// Nik has said that InvalidInstance should be thrown for cases where the model cannot be converted
// So, we use the actual CNF error as the message and throw a SolverError from it
return Err(SolverError::InvalidInstance(SOLVER, message));
let message = format!("{:?}", error);
return Err(SolverError::NotSupported(SOLVER, message));
}
}
}
Expand Down

0 comments on commit ac6a5df

Please sign in to comment.