Skip to content

chore(bqjdbc): enhance exception messages to include chained exception message#12996

Merged
logachev merged 5 commits intomainfrom
kirl/ehanced_exception_message
May 5, 2026
Merged

chore(bqjdbc): enhance exception messages to include chained exception message#12996
logachev merged 5 commits intomainfrom
kirl/ehanced_exception_message

Conversation

@logachev
Copy link
Copy Markdown
Contributor

@logachev logachev commented May 4, 2026

Some tools display to the user only top-level exception message. In order to avoid hiding underlying issues, modify JDBC messages to always include underlying reason if available.

@logachev logachev requested review from a team as code owners May 4, 2026 20:56
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a centralized utility class, BigQueryJdbcExceptionUtils, to standardize exception message formatting across the JDBC driver's exception hierarchy. By appending the cause's message to the primary error message, the changes improve diagnostic clarity. The feedback suggests making the utility class package-private to follow the principle of least privilege and refining the message formatting to consistently include the exception type for better debugging.

@logachev logachev changed the title chore(bqjdbc): ehance exception messages to include chained exception message chore(bqjdbc): enhance exception messages to include chained exception message May 5, 2026
super("Coercion error", cause);
LOG.severe("Coercion error", this);
super(BigQueryJdbcExceptionUtils.formatMessage("Coercion error", cause), cause);
LOG.severe(this.getMessage(), this);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: My latest PR removes the severe logs from the exception classes. You can leave these unedited, it will be removed later.

@logachev logachev merged commit c7f44aa into main May 5, 2026
129 of 131 checks passed
@logachev logachev deleted the kirl/ehanced_exception_message branch May 5, 2026 18:26
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.

2 participants