Currently when data cannot be downloaded the failure is not graceful and the error is not explicit. It would be great to catch downloads failures and return a clear error to speed up debugging.
For example when downloading the Colombian subnational data we see the following error:
Backtrace:
█
1. ├─data.table::setDT(covidregionaldata::get_regional_data(country = "colombia"))
2. └─covidregionaldata::get_regional_data(country = "colombia")
3. └─data %>% left_join_region_codes(region_codes_table, by = c(region_level_1 = "region"))
4. ├─base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
5. └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
6. └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
7. └─covidregionaldata:::`_fseq`(`_lhs`)
8. └─magrittr::freduce(value, `_function_list`)
9. ├─base::withVisible(function_list[[k]](value))
10. └─function_list[[k]](value)
11. └─covidregionaldata:::left_join_region_codes(...)
12. ├─dplyr::left_join(data, region_codes_table, by = by, ...)
13. └─dplyr:::left_join.data.frame(...)