Skip to content

Commit

Permalink
plugins/ImportBibTeX: Catch all xdkbib::File::readFromFile exceptions
Browse files Browse the repository at this point in the history
Better having an error message when bibtex file parsing failed
than crashing.
  • Loading branch information
anlambert committed Oct 18, 2024
1 parent 9ef65fd commit f5e7b68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/import/BibTeX/ImportBibTeX.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* Copyright (C) 2019-2023 The Talipot developers
* Copyright (C) 2019-2024 The Talipot developers
*
* Talipot is a fork of Tulip, created by David Auber
* and the Tulip development Team from LaBRI, University of Bordeaux
Expand Down Expand Up @@ -344,6 +344,8 @@ class ImportBibTeX : public ImportModule {
sstr << "BibTeX file parsing error at char " << e.column() << " of line " << e.line() << ": "
<< e.what() << endl;
pluginProgress->setError(sstr.str());
} catch (exception &e) {
pluginProgress->setError("BibTeX file could not be parsed: " + string(e.what()));
}

result = !graph->isEmpty();
Expand Down

0 comments on commit f5e7b68

Please sign in to comment.