Skip to content
Snippets Groups Projects
Commit da39416d authored by Gerardo Tauriello's avatar Gerardo Tauriello
Browse files

SCHWED-2893: graceful exception handling for invalid fragdb queries

parent 3ccbaeec
No related branches found
No related tags found
No related merge requests found
...@@ -289,10 +289,17 @@ void FragDB::SearchDB(const StemCoordPair& stems, ...@@ -289,10 +289,17 @@ void FragDB::SearchDB(const StemCoordPair& stems,
std::vector<FragmentInfo>& fragments, std::vector<FragmentInfo>& fragments,
uint extra_bins) { uint extra_bins) {
std::vector<StemPairGeom> stem_pairs = MakeStemPairGeom(stems.first, std::vector<StemPairGeom> stem_pairs;
stems.second, try {
frag_size, stem_pairs = MakeStemPairGeom(stems.first, stems.second, frag_size,
extra_bins); extra_bins);
} catch (const promod3::Error&) {
// MakeStemPairGeom can fail if distance bin is out of bounds
// -> this is ok here as it simply means that we have no fitting fragments
// in this FragDB
// => silently ignore and keep fragments vector unchanged
return;
}
for(std::vector<StemPairGeom>::iterator it = stem_pairs.begin(); for(std::vector<StemPairGeom>::iterator it = stem_pairs.begin();
it != stem_pairs.end(); ++it){ it != stem_pairs.end(); ++it){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment