With base R code, we can be fairly certain that when we try-catch a command, if it fails then we'll have access to the message. For example:
> tryCatch(mtcars["test"], error = function(e) e$message)
[1] "undefined columns selected"
I just tried this with the equivalent dplyr function, and I was surprised to find out that the error thrown by dplyr doesn't contain a message.
> tryCatch(dplyr::select(mtcars, "test"), error = function(e) e$message)
[1] ""
The dplyr error, when not inside a try-catch, does write the error to the console, but that's not what I want. Does anyone know how to retrieve the message, and also why RStudio chose to do it this way?