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

Error chaining tweaks #1963

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Error chaining tweaks #1963

wants to merge 3 commits into from

Conversation

olivroy
Copy link
Contributor

@olivroy olivroy commented Mar 11, 2024

Just a little proof of concept. Addresses #1956 (comment)

With the usage of cli, the error messages have become a little bit more verbose.

However, I believe that usethis error messages are usually very clear, and the error trace is rarely needed.

This PR adds a default of call = NULL for usethis errors.

I overrode this default where I felt like it would be useful.

Also used call = caller_env() where it felt appropriate.

So for example, before if you called use_package_doc() on a non-package project. You'd get Error in check_is_package()

# before with project
use_package_doc()
#> Error in `check_is_package()`
#> Error message...

# with this PR
use_package_doc()
#> Error in `use_package_doc()`
#> Error message ...

I still consider this a bit incomplete, but thought I'd share in case you had some work started on this.

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.

None yet

1 participant