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

Improve error message for unsupported protobuf version #24

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

sgrebnov
Copy link
Collaborator

@sgrebnov sgrebnov commented Sep 23, 2024

🗣 Description

Improve error message for unsupported (older) protobuf version conflicting with required one.

Note: tried several approaches to detect the Protobuf version at runtime, but they were unreliable, often returning null. As a result, I'm detecting Protobuf issues using a specific exception type and message during the query call.

@sgrebnov sgrebnov self-assigned this Sep 23, 2024
@@ -138,6 +138,11 @@ public FlightStream query(String sql) throws ExecutionException {
} catch (RetryException e) {
Throwable err = e.getLastFailedAttempt().getExceptionCause();
throw new ExecutionException("Failed to execute query due to error: " + err.toString(), err);
} catch (ExecutionException e) {
if (isUnsupportedProtobufVersionException(e.getCause())) {
throw new ExecutionException("Unsupported protobuf version has been detected. Please upgrade 'com.google.protobuf' dependency to version 3.25.x or later.", e);
Copy link

Choose a reason for hiding this comment

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

Should note which version was detected.

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