diff --git a/R/SDA_query.R b/R/SDA_query.R index 74f33c7d..5f3ff862 100644 --- a/R/SDA_query.R +++ b/R/SDA_query.R @@ -160,6 +160,11 @@ SDA_query <- function(q, dsn = NULL) { encode = "form" ), silent = TRUE) + if (inherits(r, 'try-error')) { + message("Soil Data Access POST request failed, returning try-error.\n\n", r) + return(invisible(r)) + } + # check response content type h <- r$all_headers if (!is.null(h)) {