Skip to content

Commit

Permalink
Merge pull request #240 from rte-antares-rpackage/feature/scenarized_bc
Browse files Browse the repository at this point in the history
api_delete() updated to return Description and Exception messages fro…
  • Loading branch information
berthetclement authored Mar 26, 2024
2 parents 2d0f86c + 6d8bd97 commit 7020c47
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion R/API-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ api_delete <- function(opts, endpoint, ..., default_endpoint = "v1/studies") {
config = config,
...
)
stop_for_status(result)
api_content <- content(result)
if(!is.null(names(api_content)))

Check warning on line 176 in R/API-methods.R

View check run for this annotation

Codecov / codecov/patch

R/API-methods.R#L175-L176

Added lines #L175 - L176 were not covered by tests
api_content <- paste0("\n[Description] : ", api_content$description,
"\n[Exception] : ", api_content$exception)
else
api_content <- NULL
stop_for_status(result, task = api_content)

Check warning on line 181 in R/API-methods.R

View check run for this annotation

Codecov / codecov/patch

R/API-methods.R#L179-L181

Added lines #L179 - L181 were not covered by tests
content(result)
}

0 comments on commit 7020c47

Please sign in to comment.