Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
equitable-equations committed Oct 6, 2024
1 parent 65c33d9 commit 8ac8271
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/download_database_internal.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ download_database_internal <- memoise::memoise(function(database_id) {
message(
paste(
"API request to universalFQA.org failed. Error",
httr::status_code(assessments_get)
httr::status_code(database_get)
)
)
return(invisible(empty))
Expand All @@ -78,6 +78,12 @@ download_database_internal <- memoise::memoise(function(database_id) {
database_text <- httr::content(database_get,
"text",
encoding = "ISO-8859-1")
if (database_text == "" |
database_text == "{ \"status\" : \"success\", \"data\" : }") {
message("No data returned. Specified database may be empty")
return(invisible(empty))
}

database_json <- jsonlite::fromJSON(database_text)
list_data <- database_json[[2]]

Expand Down

0 comments on commit 8ac8271

Please sign in to comment.