-
Notifications
You must be signed in to change notification settings - Fork 8
Return more informative error from deduplication #308
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
Conversation
R/deduplicate.R
Outdated
| fsep = "/") | ||
|
|
||
| paths <- file.path(config$root, "archive", files$path) | ||
| exists <- vlapply(paths, file.exists) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder about looking for the existence of file.path(config$root, "metadata") (or perhaps that there is at least one file within that directory); that would be stricter and easier to check? What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to fail with a specific message for people who have done a pull with recursive = FALSE then this works. People could still be in a state where they get a not very informative error later though from the stopifnot call. Say if they have deleted a report but not rebuilt the database.
R/deduplicate.R
Outdated
| paths <- file.path(config$root, "archive", files$path) | ||
| exists <- vlapply(paths, file.exists) | ||
| if (any(!exists)) { | ||
| stop(paste0("Cannot deduplicate archive as database references files ", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nicer to construct with paste and drop the trailing whitespace at the end of each string
Codecov Report
@@ Coverage Diff @@
## master #308 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 41 41
Lines 4473 4480 +7
=========================================
+ Hits 4473 4480 +7
Continue to review full report at Codecov.
|
I've put this error in as soon as we list the paths to fail early. And not removed the
which is what Oli has been seeing error previously. I can remove it if you think no longer relevant