Skip to content

Commit 7ef661d

Browse files
committed
refine error handling when statcan is down
1 parent ff894bc commit 7ef661d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

R/cansim_tables_list.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ list_cansim_cubes <- function(lite=FALSE,refresh=FALSE,quiet=FALSE){
9393
warning("Could not retrieve cube list from StatCan servers.")
9494
return(NULL)
9595
}
96-
if (r$status_code==200) {
96+
if (!is.null(r$status_code) && r$status_code==200) {
9797
content <- httr::content(r)
9898

9999
header <- content[[1]] %>%

0 commit comments

Comments
 (0)