Skip to content

Commit

Permalink
catch errors opening MMCIFs
Browse files Browse the repository at this point in the history
  • Loading branch information
agrossfield committed Mar 29, 2024
1 parent 9ffd6b4 commit 74e6e8c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/mmcif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ namespace loos {
}

void MMCIF::read(const std::string& filename) {
auto structure = gemmi::read_structure_file(filename, gemmi::CoorFormat::Mmcif);
gemmi::Structure structure;
try {
structure = gemmi::read_structure_file(filename, gemmi::CoorFormat::Mmcif);
} catch (...) {
throw(FileOpenError(filename));
}
auto unit_cell = structure.cell;
auto box = loos::GCoord(unit_cell.a, unit_cell.b, unit_cell.c);

Expand Down

0 comments on commit 74e6e8c

Please sign in to comment.