Skip to content

Commit

Permalink
suppress warnings when fragile caught system calls fail
Browse files Browse the repository at this point in the history
  • Loading branch information
slager committed Sep 26, 2024
1 parent baa672e commit db9906c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/reproducibility_tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ get_full_name <- function(id = NULL){
Linux = {
if (is.null(id)) {id <- Sys.getenv("USER")}
myargs <- paste0("-x -h ldapint.pc.scharp.org -b dc=scharp,dc=org uid=", id)
user <- tryCatch({system2("ldapsearch", args = myargs, stdout = TRUE)},
user <- tryCatch({system2("ldapsearch", args = myargs, stdout = TRUE, stderr = FALSE)},
warning = function(w){NULL},
error = function(e){NULL})
user <- user[grep("cn:", user)]
Expand All @@ -48,7 +48,7 @@ get_full_name <- function(id = NULL){
Darwin = {
if (is.null(id)) {id <- Sys.getenv("USER")}
myargs <- paste0("-x -h ldapint.pc.scharp.org -b dc=scharp,dc=org uid=", id)
user <- tryCatch({system2("ldapsearch", args = myargs, stdout = TRUE)},
user <- tryCatch({system2("ldapsearch", args = myargs, stdout = TRUE, stderr = FALSE)},
warning = function(w){NULL},
error = function(e){NULL})
user <- user[grep("cn:", user)]
Expand Down

0 comments on commit db9906c

Please sign in to comment.