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

Could you clarify the section on condition classes when testing for errors? #980

Open
EllaKaye opened this issue Apr 11, 2023 · 0 comments
Labels

Comments

@EllaKaye
Copy link
Contributor

Hello,

The R Packages (2e) book is fantastic and has been enormously helpful as I'm developing a new package. Having read it now all the way through, there is just one section that left me a bit confused, in 14.5.2 on testing errors. Would it be possible to clarify the part about the class of a condition? It would be really good to have an example here (or earlier in the book) of how to attach a custom class to a condition, when writing a function, ready for use in expect_error(). (I did figure it out, but it took digging through the source code of stringr, then rlang, plus a chapter of Advanced R and a couple of other blog posts to get there).

(If this counts as a contribution, then I assign the copyright of said contribution to Hadley Wickham).

@jennybc jennybc added the Testing label May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants