Skip to content

Commit 9a18bbd

Browse files
committed
Raise invalid_argument when InitSpaceGroup fails
Throw `invalid_argument` instead of `ObjCrystException`. Avoid XML state files that are created by ObjCrystException.
1 parent a38c06e commit 9a18bbd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ObjCryst/ObjCryst/CIF.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,12 +1120,12 @@ Crystal* CreateCrystalFromCIF(CIF &cif,const bool verbose,const bool checkSymAsX
11201120
unsigned int bestscore=0;
11211121
for(vector<string>::const_iterator posOrig=origin_list.begin();posOrig!=origin_list.end();++posOrig)
11221122
{
1123-
// The origin extension may not make sense, so we need to watch for ObjCrystException
1123+
// The origin extension may not make sense, so we need to watch for exception
11241124
try
11251125
{
11261126
pCryst->GetSpaceGroup().ChangeSpaceGroup(hmorig+*posOrig);
11271127
}
1128-
catch(ObjCrystException e)
1128+
catch(invalid_argument)
11291129
{
11301130
continue;
11311131
}

ObjCryst/ObjCryst/SpaceGroup.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ void SpaceGroup::InitSpaceGroup(const string &spgId)
603603
{
604604
(*fpObjCrystInformUser)("Could not interpret Spacegroup Symbol:"+spgId);
605605
string emsg = "Space group symbol '" + spgId + "' not recognized";
606-
throw ObjCrystException(emsg);
606+
throw invalid_argument(emsg);
607607
}
608608
}
609609

@@ -654,7 +654,7 @@ void SpaceGroup::InitSpaceGroup(const string &spgId)
654654
}
655655
VFN_DEBUG_EXIT("SpaceGroup::InitSpaceGroup() could not interpret spacegroup:"<<spgId<<":"<<ex.what(),8)
656656
string emsg = "Space group symbol '" + spgId + "' not recognized";
657-
throw ObjCrystException(emsg);
657+
throw invalid_argument(emsg);
658658
}
659659

660660
mExtension=this->GetCCTbxSpg().match_tabulated_settings().extension();

0 commit comments

Comments
 (0)