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

find_package_root_file has uninformative error context #119

Open
JosiahParry opened this issue Nov 22, 2024 · 1 comment
Open

find_package_root_file has uninformative error context #119

JosiahParry opened this issue Nov 22, 2024 · 1 comment

Comments

@JosiahParry
Copy link

I recently noticed that when rprojroot fails to find a file, the error that is shown is from normalizePath() and it doesn't show that it comes from find_package_root_file().

rprojroot::find_package_root_file("DESCRIPTION", path = "../definitelynot")
#> Error in `normalizePath()`:
#> ! path[1]="../definitelynot": No such file or directory

It would be very nice if there were an error_call = rlang::caller_call() argument here so that nicer error messages can be bubbled up. We use {rprojroot} extensively in {rextendr}.

@krlmlr
Copy link
Member

krlmlr commented Nov 24, 2024

So far, rprojroot is free of hard dependencies, I'd like to keep it that way. Would your proposed solution work if rlang and/or fs were only suggested?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants