Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit

Permalink
fix catch in errorMessages.h
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeplf committed Mar 4, 2022
1 parent 5af346a commit b405598
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/morphio/errorMessages.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ struct DebugInfo {

/** Get section's line number within morphology file */
int32_t getLineNumber(uint32_t sectionId) const {
try {
return _lineNumbers.at(sectionId);
} catch (const std::out_of_range&) {
const auto it = _lineNumbers.find(sectionId);
if (it == _lineNumbers.end()) {
return -1;
}
return it->second;
}
/** Morphology filename */
std::string _filename;
Expand Down

0 comments on commit b405598

Please sign in to comment.