You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/11/02 04:24:32 UTC

[GitHub] [druid] TSFenwick commented on a change in pull request #11843: Use a simple class to sanitize JDBC exceptions and also log them

TSFenwick commented on a change in pull request #11843:
URL: https://github.com/apache/druid/pull/11843#discussion_r740711307



##########
File path: sql/src/main/java/org/apache/druid/sql/avatica/DruidMeta.java
##########
@@ -621,7 +613,12 @@ private DruidConnection getDruidConnection(final String connectionId)
     final DruidConnection connection = connections.get(connectionId);
 
     if (connection == null) {
-      throw logFailure(new NoSuchConnectionException(connectionId));
+      NoSuchConnectionException noSuchConnectionException = new NoSuchConnectionException(connectionId);
+      // this is to avoid an unecessary cast of NoSuchConnectionException to a runtime exception.
+      if (errorHandler.hasAffectingErrorResponseTransformStrategy()) {

Review comment:
       I can't put that inside the `ErrorHandler` because of the method's typing where everything becomes a runtime exception even if there is no error response strategy.
   I can out a specific method that preserves this type for the `ErrorHandler`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org