Skip to content

Commit

Permalink
version bump, add error log publish fails
Browse files Browse the repository at this point in the history
  • Loading branch information
pinduzera committed Aug 7, 2023
1 parent e725cd9 commit 36f25df
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: sasctl
Title: The sasctl package enables easy communication between the SAS Viya platform APIs and the R runtime
Version: 0.7.2
Version: 0.7.3
Author: Eduardo Hellas
Authors@R: c(
person(given = "Eduardo",
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# sasctl 0.7.3

* Fixed `publish_model` exact argument
* Added SAS log to error message when `publish_model` fails.

# sasctl 0.7.2

* Fixed when registering models with variables missing label/measurement metadata
Expand Down
9 changes: 6 additions & 3 deletions R/model_management.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ publish_model <- function(session, model, name,
name = model[["name"]] ,
notes = "Published from RSasclt", # model$description,
modelContents = list(list(modelName = name,
sourceUri = model$links[model$links$rel == "self",]$uri,
sourceUri = model$links[model$links$rel == "self",][["uri"]],
publishLevel = "model")),
destinationName = destination
)
Expand All @@ -63,7 +63,7 @@ publish_model <- function(session, model, name,

Sys.sleep(1)

publish <- vGET(session, publish$links[publish$links$rel == "self",]$uri,
publish <- vGET(session, publish$links[publish$links$rel == "self",][["uri"]],
...)

}
Expand All @@ -76,7 +76,10 @@ publish_model <- function(session, model, name,
}

if (publish$state == "failed") {
stop("The model publication failed")
logmsg <- vGET(session, publish$links[publish$links$rel ==
"publishingLog", ][["uri"]])[["log"]]

stop(paste("The model publication failed with log:", logmsg))
}


Expand Down

0 comments on commit 36f25df

Please sign in to comment.