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

Function to extract/report results from eval_capture_conditions() #282

Closed
ddsjoberg opened this issue Jul 24, 2024 · 1 comment
Closed
Milestone

Comments

@ddsjoberg
Copy link
Collaborator

When using eval_capture_conditions() the results are returned as a named list. I find myself writing similar code after each call:

  1. Is the warning entry non-empty? If so, print the warning and continue
  2. Is the error entry non-empty? If so, depending on the context, we want to print the error and stop, or continue in a safe manner without the result.
  3. If no errors or warnings, continue with the code.

I think we can streamline this in a function.

@ddsjoberg ddsjoberg added this to the v0.3.0 milestone Jul 25, 2024
ddsjoberg added a commit that referenced this issue Sep 16, 2024
**What changes are proposed in this pull request?**
* Added functions for printing results from `eval_capture_conditions()`.
Captured conditions can be printed as either errors or messages with
`captured_condition_as_error()` and `captured_condition_as_message()`,
respectively. (#282)

**Reference GitHub issue associated with pull request.** _e.g., 'closes
#<issue number>'_
#282


--------------------------------------------------------------------------------

Pre-review Checklist (if item does not apply, mark is as complete)
- [ ] **All** GitHub Action workflows pass with a ✅
- [ ] PR branch has pulled the most recent updates from master branch:
`usethis::pr_merge_main()`
- [ ] If a bug was fixed, a unit test was added.
- [ ] Code coverage is suitable for any new functions/features
(generally, 100% coverage for new code): `devtools::test_coverage()`
- [ ] Request a reviewer

Reviewer Checklist (if item does not apply, mark is as complete)

- [ ] If a bug was fixed, a unit test was added.
- [ ] Run `pkgdown::build_site()`. Check the R console for errors, and
review the rendered website.
- [ ] Code coverage is suitable for any new functions/features:
`devtools::test_coverage()`

When the branch is ready to be merged:
- [ ] Update `NEWS.md` with the changes from this pull request under the
heading "`# cards (development version)`". If there is an issue
associated with the pull request, reference it in parentheses at the end
update (see `NEWS.md` for examples).
- [ ] **All** GitHub Action workflows pass with a ✅
- [ ] Approve Pull Request
- [ ] Merge the PR. Please use "Squash and merge" or "Rebase and merge".

---------

Signed-off-by: Daniel Sjoberg <danield.sjoberg@gmail.com>
@ddsjoberg
Copy link
Collaborator Author

Added in #322

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

No branches or pull requests

1 participant