Skip to content

Commit

Permalink
don't report error expected at end of file
Browse files Browse the repository at this point in the history
  • Loading branch information
l-k- committed Feb 8, 2024
1 parent 60a1ec4 commit b11ed0f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/GENEActivReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,12 @@ Rcpp::List GENEActivReader(std::string filename, std::size_t start = 0, std::siz
i++;
} catch (const std::exception& ex) {
errCounter++;
Rcpp::Rcerr << "data error at i = " << i << " : " << ex.what() << "\n";
std::string err_text = ex.what();

// report any error other than the one expected at the end of file
if (err_text.find("stoll: no conversion") == std::string::npos) {
Rcpp::Rcerr << "data error at i = " << i << " : " << err_text << "\n";
}
break; // rest of this block could be corrupted
}
}
Expand Down

0 comments on commit b11ed0f

Please sign in to comment.