Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messages #119

Closed
wants to merge 2 commits into from
Closed

Improve error messages #119

wants to merge 2 commits into from

Conversation

warnes
Copy link

@warnes warnes commented Aug 7, 2015

to provide more information.

  • For read_xlx, when the requested worksheets doesn't exist.
  • For read_xlx, and read_xlsx, when the number of column names or types doesn't match the file.

warnes and others added 2 commits August 6, 2015 18:49
… to test because R CMD check fails on my work system with segfaults for the unmodified source code.
Rcpp::stop("Invalid sheet index");

if (i < 0 || i >= wb.nSheets()) {
Rcpp::stop(Rcpp::sprintf<80>( "Invalid sheet index. Should be in [0, %d]", wb.nSheets() ).c_str());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure stop() already wraps sprintf, so you can just do: Rcpp::stop("Invalid sheet index. Should be in [0, %d]", wb.nSheets()); . If not, I'd recommend using tinyformat which Rcpp bundles.

Why %d and not %i?

@behrica
Copy link

behrica commented Jan 18, 2016

Very usefull pach. Without it I cannot 'guess' how many blank columns I have.

@jennybc
Copy link
Member

jennybc commented Feb 12, 2017

I'm afraid this got handled in a larger refactoring of column specification and naming (#261), so I'm closing this. Thanks!

@jennybc jennybc closed this Feb 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants