Skip to content

Commit

Permalink
Merge pull request #59 from wadpac/issue-58-stoll-no-conversion
Browse files Browse the repository at this point in the history
Issue #58 Don't print error when more data is requested from readGENEActiv() than is available in the file
  • Loading branch information
vincentvanhees authored Feb 28, 2024
2 parents 354ac46 + b11ed0f commit 0efae7e
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 = %d: %s 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 0efae7e

Please sign in to comment.