-
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
A failing query using DBI::dbGetQuery()
yields a useless error message
#859
Comments
Huh. Thanks for the thorough issue description! Triple checking the cli inline markup here (and that it's tested thoroughly) and not seeing anything that jumps out to me. I'm wondering if there's some nonstandard formatting in the driver message from Hana DB that introduces issues with cli. Trying to inline some numbers in different substitutions to trigger that "unexpected numeric constant" error but no dice. Could you please run the following code before your code that triggers the error and then paste your console output here? library(odbc)
testthat::local_mocked_bindings(
rethrow_database_error = function(msg, call = "") {
print(dput(msg))
print(call)
invisible()
},
.package = "odbc"
) |
Hi, I managed to get a sample, I censored IP adresses, session IDs and the SQL statement itself in the hope that those parts don't contain the crucial bits.
|
When a query fails in
DBI::dbGetQuery()
a useless error message is shown instead of quoting the error message that is issued by the remote data base:Since the error depends on the remote system (HANA DB) and a failing query the issue is hard to reproduce, so I cannot share a useful reprex.
It looks like some problems when parsing the remote error message (see https://rlang.r-lib.org/reference/topic-condition-formatting.html#transitioning-from-abort-to-cli-abort-) in this code piece:
odbc/R/utils.R
Lines 162 to 178 in bd66867
Stack trace
The text was updated successfully, but these errors were encountered: