Skip to content
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

More accurate bind errors #48

Merged
merged 1 commit into from
Aug 28, 2024
Merged

More accurate bind errors #48

merged 1 commit into from
Aug 28, 2024

Conversation

elefeint
Copy link
Contributor

Right now, if the query is invalid, the error message is unhelpful -- "Attempting to execute an unsuccessfully prepared statement!". This PR surfaces bind errors instead of trying to run the invalid query.

I also threw in a couple of extra log lines in Truncate endpoint because that's the best guess so far about what's segfaulting for some but not all connectors in prod.

@elefeint elefeint requested a review from hrl20 August 26, 2024 13:29
Copy link
Contributor

@hrl20 hrl20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@elefeint elefeint merged commit 9aa84bb into main Aug 28, 2024
1 check passed
@elefeint elefeint deleted the better_bind_errors branch August 28, 2024 21:34
mdlog::info("truncate_table: " + query);
auto statement = con.Prepare(query);
if (statement->HasError()) {
throw std::runtime_error(err + " (at bind step):" + statement->GetError());
Copy link
Member

@guenp guenp Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we say at bind step twice, effectively:
"Error truncating table at bind step <" + absolute_table_name + ">" + " (at bind step):"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants