We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents fcf7fc3 + 33f6ec8 commit 57ab8b5Copy full SHA for 57ab8b5
R/sources.R
@@ -64,7 +64,13 @@ mi_sources <- function(
64
httr2::req_perform()
65
66
response_data <- httr2::resp_body_json(response, simplifyVector = TRUE) |>
67
- tibble::as_tibble() |>
+ tibble::as_tibble()
68
+
69
+ if(nrow(response_data) == 0){
70
+ stop(paste0("No sources found for year ", year, ". Please specify a different year."))
71
+ }
72
73
+ response_data <- response_data |>
74
dplyr::rename(
75
description = .data$f_description,
76
source_name = .data$f_resource,
@@ -76,6 +82,8 @@ mi_sources <- function(
82
.data$description
77
83
)
78
84
85
86
79
87
return(response_data)
80
88
}
81
89
0 commit comments