From 4d8e619ebae2c79537adaa2bc4ab49e39d863560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Berthet?= Date: Tue, 4 Jul 2023 12:47:18 +0200 Subject: [PATCH] Revert "Revert "Ant770/api error mess" (#212)" This reverts commit cdbb4331f7979db1fbef75689369e7cb41238f74. --- NEWS.md | 1 - R/API-methods.R | 6 +++--- R/utils_api.R | 4 +--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/NEWS.md b/NEWS.md index 9ebe327c..74ab7822 100644 --- a/NEWS.md +++ b/NEWS.md @@ -20,7 +20,6 @@ BUGFIXES : * `setSimulationPathAPI` generate new global parameter `sleep` to add timer to API request * Correction of `.importOutput()` to use `readAntares()` with `parallel == TRUE` in shiny application -* `setSimulationPathAPI()` delete a redundant API request DATA : diff --git a/R/API-methods.R b/R/API-methods.R index b0ed718e..df9f7e3c 100644 --- a/R/API-methods.R +++ b/R/API-methods.R @@ -58,10 +58,10 @@ api_get <- function(opts, endpoint, ..., default_endpoint = "v1/studies") { if(condition_status_check){ mess_error <- content(result) mess_error <- paste0("\n[description] : ", mess_error$description, - "\n[IniReaderError] : ", mess_error$exception) + "\n[IniReaderError]", mess_error$exception) stop_for_status(result, task = mess_error) - }else - warn_for_status(result) + }else + warn_for_status(result) content(result) } diff --git a/R/utils_api.R b/R/utils_api.R index b48eaf0d..63c4fd92 100644 --- a/R/utils_api.R +++ b/R/utils_api.R @@ -256,9 +256,8 @@ read_secure_json <- function(url, token = NULL, timeout = 60, config = list()) { }, allLinks, names(allLinks))) - # info <- read_secure_json(studyPath, ...) - + antaresVersion <- paths$version params <- read_secure_json(file.path(studyPath, "settings", "generaldata"), ...) @@ -398,7 +397,6 @@ setSimulationPathAPI <- function(host, study_id, token, simulation = NULL, res$httr_config <- httr_config res$modeAPI <- "sync" - # delete version to keep only "antares_version" res$version <- NULL