Closed collinschwantes closed 2 years ago
The answer to why this wish isn't particularly easy to grant is the same as in the linked gargle issue. I do note this as something that would be nice to do, but there are other priorities for attention over in gargle.
This runs counter to the design of
gargle::token_fetch()
. By design, it tries a series of auth methods, all wrapped intryCatch()
. Errors are to be expected and it's designed to soldier on and, eventually, ends up the interactive flow of last resort.Basically, the fact that it "just works" for so many people means that there is a higher bar for folks using it in more advanced ways, i.e. with arguments.
So the frank answer is: make sure to pass a path to a file that actually exists :sweat_smile:
Ah okay - thanks for the explanation. We will check for the file before passing the path to the gs4_auth
key_path <- "./auth/secret.json"
if(file.exists(key_path)){
gs4_auth(path = key_path)
} else {
stop("informative error message")
}
When a path is provided to
gs4_auth
that does not resolve to a file, the function automatically enters interactive mode. It would be nice if the function warned you or errored out if the file does not exist at that path.Brief description of the problem:
function enters interactive mode without signaling to user that a file doesnt exist.