Skip to content

Commit

Permalink
fix #197
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEdmondson1234 committed Dec 1, 2020
1 parent 29872ad commit cb1e1b4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions R/service_creation.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ gar_service_create <- function(

candidate <- sprintf("%s@%s.iam.gserviceaccount.com",
accountId, projectId)
tryCatch(

o <- tryCatch(
gar_service_get(candidate, projectId = projectId),
error = function(err){
need_one <- grepl(paste(candidate, "does not exist"), err$message)

# watch out if they update the error message
need_one <- grepl(paste("Not found"), err$message)
if(need_one){
myMessage("Creating new service account: ", candidate, level = 3)
the_url <- sprintf(
Expand All @@ -96,6 +98,7 @@ gar_service_create <- function(
stop(err$message)
}
})
o

}

Expand Down

0 comments on commit cb1e1b4

Please sign in to comment.