lukasz-antoniak commented on code in PR #1906:
URL: 
https://github.com/apache/cassandra-gocql-driver/pull/1906#discussion_r2325095391


##########
conn.go:
##########
@@ -1317,7 +1317,24 @@ func (c *Conn) execInternal(ctx context.Context, req 
frameBuilder, tracer Tracer
                defer c.releaseStream(call)
 
                if v := resp.framer.header.version.version(); v != c.version {
-                       return nil, NewErrProtocol("unexpected protocol version 
in response: got %d expected %d", v, c.version)
+                       errProtocol := NewErrProtocol("unexpected protocol 
version in response: got %d expected %d", v, c.version)
+                       responseFrame, err := resp.framer.parseFrame()
+                       if err != nil {
+                               c.logger.Warning("Framer error while attempting 
to parse potential protocol error.",
+                                       newLogFieldError("err", err))
+                               return nil, errProtocol
+                       }
+                       //goland:noinspection GoTypeAssertionOnErrors
+                       errFrame, isErrFrame := responseFrame.(errorFrame)
+                       if !isErrFrame {

Review Comment:
   NIT: How about merging two below conditions together?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to