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

Closed
wants to merge 4 commits into from
Closed

Error chaining tweaks #1963

wants to merge 4 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.

I haven't tested it that much since I have other usethis branches installed, but from my observations in the past months, I still think that some calls don't help understanding the error, so this route is probably worth pursuing

@olivroy olivroy marked this pull request as ready for review June 12, 2024 12:23
@olivroy olivroy closed this Jul 23, 2024
@olivroy
Copy link
Contributor Author

olivroy commented Jul 23, 2024

not worth it

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.

1 participant