You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{cli_,}{abort,warn,inform} expect the entire message inside message; ... is used to add named fields to the condition object that they create (so you can extract extra info from, e.g., rlang::last_error()$<name>). I'm getting
Error in `warning_cnd()`:
! Conditions must have named data fields
---
Backtrace:
▆
1. ├─epidatr::pub_covidcast(...)
2. │ └─... %>% fetch(fetch_args = fetch_args) at cmu-delphi-epidatr-b5f819a/R/endpoints.R:747:2
3. ├─epidatr::fetch(., fetch_args = fetch_args)
4. │ └─epidatr:::cache_epidata_call(epidata_call, fetch_args = fetch_args) at cmu-delphi-epidatr-b5f819a/R/epidatacall.R:207:2
5. │ └─cli::cli_warn(...) at cmu-delphi-epidatr-b5f819a/R/cache.R:253:6
6. │ └─rlang::warn(format_warning(message, .envir = .envir), ...)
7. │ └─rlang::warning_cnd(...)
8. └─rlang::abort(message = message)
from
cli::cli_warn("using cached results with `as_of` within the past week (or the future!). This will likely result ",
"in an invalid cache. Consider\n",
"1. disabling the cache for this session with `disable_cache` or permanently with environmental ",
"variable `EPIDATR_USE_CACHE=FALSE`\n",
"2. setting `EPIDATR_CACHE_MAX_AGE_DAYS={Sys.getenv('EPIDATR_CACHE_MAX_AGE_DAYS', unset = 1)}` to e.g. `3/24` ",
"(3 hours).",
.frequency = "regularly",
.frequency_id = "cache timing issues",
class = "cache_recent_data"
)
Fix is just wrapping up all the message parts in a character vector using c.
The text was updated successfully, but these errors were encountered:
cli::cli_warn(
c(
"Using cached results with `as_of` within the past week (or the future!). This will likely result in an invalid cache. Consider:",
"i"="disabling the cache for this session with `disable_cache` or permanently with environmental variable `EPIDATR_USE_CACHE=FALSE`",
"i"="setting `EPIDATR_CACHE_MAX_AGE_DAYS={Sys.getenv('EPIDATR_CACHE_MAX_AGE_DAYS', unset = 1)}` to e.g. `3/24` (3 hours)."
),
.frequency="regularly",
.frequency_id="cache timing issues",
class="cache_recent_data"
)
{cli_,}{abort,warn,inform}
expect the entire message insidemessage
;...
is used to add named fields to the condition object that they create (so you can extract extra info from, e.g.,rlang::last_error()$<name>
). I'm gettingfrom
Fix is just wrapping up all the message parts in a character vector using
c
.The text was updated successfully, but these errors were encountered: