-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add more informative error message with bad classif
- Loading branch information
Showing
1 changed file
with
15 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,20 +90,27 @@ check_classification <- function(data, | |
abort_all_sec_classif_unknown <- function(column, known) { | ||
abort( | ||
class = "all_sec_classif_unknown", | ||
message = glue( | ||
"Some `{column}` must be known, i.e. one of: | ||
{collapse2(known)}" | ||
) | ||
message = c( | ||
glue("Some `{column}` must be known, i.e. one of: {collapse2(known)}"), | ||
"i" = "If you wish to request a new sector classification system, please create an issue here:", | ||
"*" = "https://github.com/RMI-PACTA/r2dii.data/issues", | ||
"i" = "Or contact the PACTA team here:", | ||
"*" = "[email protected]" | ||
), | ||
use_cli_format = TRUE | ||
) | ||
} | ||
|
||
warn_some_sec_classif_unknown <- function(column, unknown) { | ||
warn( | ||
class = "some_sec_classif_unknown", | ||
message = glue( | ||
"Some `{column}` are unknown: | ||
{collapse2(unknown)}" | ||
) | ||
message = c( | ||
glue("Some `{column}` are unknown:{collapse2(unknown)}"), | ||
"i" = "If you wish to request a new sector classification system, please create an issue here:", | ||
"*" = "https://github.com/RMI-PACTA/r2dii.data/issues", | ||
"i" = "Or contact the PACTA team here:", | ||
"*" = "[email protected]" | ||
) | ||
) | ||
|
||
invisible(column) | ||
|