diff --git a/NAMESPACE b/NAMESPACE index deb945e..1dca550 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -104,6 +104,7 @@ importFrom(plyr,llply) importFrom(purrr,quietly) importFrom(shiny,getDefaultReactiveDomain) importFrom(shiny,incProgress) +importFrom(shiny,isRunning) importFrom(shiny,withProgress) importFrom(stats,as.formula) importFrom(stats,setNames) diff --git a/NEWS.md b/NEWS.md index d734f89..ff77eb8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,7 +12,7 @@ NEW FEATURES: It contains a table with group dimensions of time series for binding constraints. * `readAntares()` new parameter **clustersST** to read (output simulation) short-term clusters * New function `readAntaresSTClusters()` - +* `fread_antares()` shiny compatible with a conditional processing of the error messages BREAKING CHANGES : diff --git a/R/utils_api.R b/R/utils_api.R index 562e31c..4a2ce51 100644 --- a/R/utils_api.R +++ b/R/utils_api.R @@ -1,4 +1,5 @@ #' @importFrom utils URLencode +#' @importFrom shiny isRunning fread_antares <- function(opts, file, ...) { if (identical(opts$typeLoad, "api")) { file <- gsub("\\.txt$", "", file) @@ -9,7 +10,10 @@ fread_antares <- function(opts, file, ...) { ) suppressWarnings( tryCatch(fread(response, ...), error = function(e){ - message(file); message(e) + if(isRunning()) + e <- as.character(e) + message(file) + message(e) })) } else { suppressWarnings(