Skip to content

refactor: Add S7_error_validation classes (fixes #602)#605

Merged
hadley merged 7 commits intoRConsortium:mainfrom
jjjermiah:jjjermiah/feat/validation-error-classes
Apr 21, 2026
Merged

refactor: Add S7_error_validation classes (fixes #602)#605
hadley merged 7 commits intoRConsortium:mainfrom
jjjermiah:jjjermiah/feat/validation-error-classes

Conversation

@jjjermiah
Copy link
Copy Markdown
Contributor

fixes #602

todo:

  • I think that this could be even more useful if it was documented for users as well?

Replace stop(msg, call. = FALSE) with stop(errorCondition(...)) in
validate() so property-type and custom-validator errors carry subclasses
S7_error_validation_property and S7_error_validation_object (both
inheriting from S7_error_validation), making them catchable via
tryCatch() without parsing message strings.
Comment thread R/valid.R Outdated
Comment thread tests/testthat/test-valid.R Outdated
Comment thread tests/testthat/test-valid.R Outdated
@hadley
Copy link
Copy Markdown
Member

hadley commented Apr 12, 2026

I think it would be good to document these, but it's not clear to me where to put that documentation such that folks are likely to find it.

@jjjermiah jjjermiah requested a review from hadley April 12, 2026 15:54
@hadley
Copy link
Copy Markdown
Member

hadley commented Apr 17, 2026

Can you please add a bullet to the top of NEWS.md? It should briefly describe the change and end with (@yourname, #issuenumber).

@hadley hadley merged commit 035db7f into RConsortium:main Apr 21, 2026
13 checks passed
@hadley
Copy link
Copy Markdown
Member

hadley commented Apr 21, 2026

Thanks!

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.

feature request: validation error class

2 participants