-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
transition to cli errors #785
Changes from all commits
1523ec9
be5456a
5f5e88b
fc1e521
2e1ac63
39fda73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,11 +14,10 @@ OdbcConnection <- function( | |
timeout = Inf, | ||
dbms.name = NULL, | ||
attributes = NULL, | ||
.connection_string = NULL | ||
.connection_string = NULL, | ||
call = caller_env(2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using test_con("SQLITE", attributes = list(boop = "bop"))
#> Error in `.local()`:
#> ! `attributes` does not support the connection attribute "boop".
#> ℹ Allowed connection attribute is "azure_token". with:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW, S4 adds the intermediate |
||
) { | ||
|
||
stopifnot(all(has_names(attributes))) | ||
stopifnot(all(names(attributes) %in% SUPPORTED_CONNECTION_ATTRIBUTES)) | ||
check_attributes(attributes, call = call) | ||
|
||
args <- compact(list(...)) | ||
check_args(args) | ||
|
@@ -51,7 +50,13 @@ OdbcConnection <- function( | |
info$dbms.name <- dbms.name | ||
} | ||
if (!nzchar(info$dbms.name)) { | ||
stop("The ODBC driver returned an invalid `dbms.name`. Please provide one manually with the `dbms.name` parameter.", call. = FALSE) | ||
cli::cli_abort( | ||
c( | ||
"!" = "The ODBC driver failed to generate a DBMS name.", | ||
"i" = "Please provide one manually with {.arg dbms.name}." | ||
), | ||
call = call | ||
) | ||
} | ||
|
||
class <- getClassDef(info$dbms.name, inherits = FALSE) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:chef kiss:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SUCH A SATISFYING DIFF