joao-r-reis commented on code in PR #1936:
URL: 
https://github.com/apache/cassandra-gocql-driver/pull/1936#discussion_r2965357344


##########
frame.go:
##########
@@ -759,10 +759,26 @@ func (f *framer) parseErrorFrame() (frame, error) {
                        return nil, err
                }
                return res, nil
-       case ErrCodeInvalid, ErrCodeBootstrapping, ErrCodeConfig, 
ErrCodeCredentials, ErrCodeOverloaded,
-               ErrCodeProtocol, ErrCodeServer, ErrCodeSyntax, ErrCodeTruncate, 
ErrCodeUnauthorized:
-               // TODO(zariel): we should have some distinct types for these 
errors
-               return errD, nil
+       case ErrCodeOverloaded:
+               return &RequestErrOverloaded{errorFrame: errD}, nil
+       case ErrCodeBootstrapping:
+               return &RequestErrBootstrapping{errorFrame: errD}, nil
+       case ErrCodeInvalid:
+               return &RequestErrInvalid{errorFrame: errD}, nil
+       case ErrCodeConfig:
+               return &RequestErrConfig{errorFrame: errD}, nil
+       case ErrCodeCredentials:
+               return &RequestErrCredentials{errorFrame: errD}, nil
+       case ErrCodeProtocol:
+               return &RequestErrProtocol{errorFrame: errD}, nil
+       case ErrCodeServer:
+               return &RequestErrServer{errorFrame: errD}, nil
+       case ErrCodeSyntax:
+               return &RequestErrSyntax{errorFrame: errD}, nil
+       case ErrCodeTruncate:
+               return &RequestErrTruncate{errorFrame: errD}, nil
+       case ErrCodeUnauthorized:
+               return &RequestErrUnauthorized{errorFrame: errD}, nil

Review Comment:
   After checking the test failures I realize that the internal protocol 
negotiation mechanism depends on these errorframes so let's keep the `Server` 
and `Protocol` errors as they were so keep the behavior so we don't have to go 
and change the protocol negotiation code in this PR



-- 
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