Skip to content

Commit

Permalink
update examples to show error message if invalid/missing API key
Browse files Browse the repository at this point in the history
  • Loading branch information
rmgpanw committed May 26, 2024
1 parent aeaf41b commit 64dfbe1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions R/download_item.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
#'
#' unzip(y, list = TRUE)
#' }
#'
#' # An informative error is raised if your API key is invalid or missing
#' try(download_item(394, TRUD_API_KEY = "INVALID_API_KEY"))
download_item <- function(item,
directory = ".",
download_file = "archive",
Expand Down
3 changes: 3 additions & 0 deletions R/get_item_metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
#' get_item_metadata(394, latest_only = FALSE) |>
#' purrr::map_at("releases", \(release) purrr::map(release, names))
#' }
#'
#' # An informative error is raised if your API key is invalid or missing
#' try(download_item(394, TRUD_API_KEY = "INVALID_API_KEY"))
get_item_metadata <- function(item,
TRUD_API_KEY = NULL,
latest_only = FALSE) {
Expand Down
3 changes: 3 additions & 0 deletions man/download_item.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/get_item_metadata.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/trud-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 64dfbe1

Please sign in to comment.