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
When there are too many filter statements, the request URL to the odata portal becomes too long and the request fails. Currently, the resulting error message is very uninformative. Most people probably don't know how to address this error.
Error in get_json(url, verbose = verbose) :
Request-URI Too Long (HTTP 414). Failed to Client error: (414) Request-URI Too Long.
Perhaps add the following lines to cbs_download_data after url <- URLencode(url):
if (nchar(url) > 2000L)
warning(paste0(c("The request URL is longer than 2000 characters. ",
"This could cause the request to fail on some platforms. ",
"If so, try to reduce the number of filter statements and filter the data afterwards.")))
Or, catch the error: something like:
res <- get_json(url, verbose = verbose)
tryCatch({
res <- get_json(url, verbose = verbose),
}, error = function(e) {
warning <- if (nchar(url) < 2000L) "" else
paste0(c("\n\nThe request URL is longer than 2000 characters. ",
"This could cause the request to fail on some platforms. ",
"Try to reduce the number of filter statements and ",
"filter the data afterwards."))
stop("Request failed with the following message:\n", e$message, warning)
})
The text was updated successfully, but these errors were encountered:
When there are too many filter statements, the request URL to the odata portal becomes too long and the request fails. Currently, the resulting error message is very uninformative. Most people probably don't know how to address this error.
Example:
This result in either the following error message:
Or sometimes the following:
Perhaps add the following lines to
cbs_download_data
afterurl <- URLencode(url)
:Or, catch the error: something like:
The text was updated successfully, but these errors were encountered: