From cb1e1b483f19e6e83f85d0f884db9e0289d958cb Mon Sep 17 00:00:00 2001 From: Mark Edmondson Date: Tue, 1 Dec 2020 19:49:58 +0100 Subject: [PATCH] fix #197 --- R/service_creation.R | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/R/service_creation.R b/R/service_creation.R index 693d111..9ba86e6 100644 --- a/R/service_creation.R +++ b/R/service_creation.R @@ -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( @@ -96,6 +98,7 @@ gar_service_create <- function( stop(err$message) } }) + o }