|
1 | 1 | use bytes::Bytes; |
2 | 2 | use futures::{future::RemoteHandle, FutureExt}; |
3 | 3 | use scylla_cql::errors::TranslationError; |
| 4 | +use scylla_cql::frame::response::Error; |
4 | 5 | use scylla_cql::frame::types::SerialConsistency; |
5 | 6 | use tokio::io::{split, AsyncRead, AsyncWrite, AsyncWriteExt, BufReader, BufWriter}; |
6 | 7 | use tokio::net::{TcpSocket, TcpStream}; |
@@ -1216,6 +1217,7 @@ pub async fn open_named_connection( |
1216 | 1217 |
|
1217 | 1218 | let mut supported = match options_result { |
1218 | 1219 | Response::Supported(supported) => supported, |
| 1220 | + Response::Error(Error { error, reason }) => return Err(QueryError::DbError(error, reason)), |
1219 | 1221 | _ => { |
1220 | 1222 | return Err(QueryError::ProtocolError( |
1221 | 1223 | "Wrong response to OPTIONS message was received", |
@@ -1269,6 +1271,7 @@ pub async fn open_named_connection( |
1269 | 1271 | Response::Authenticate(authenticate) => { |
1270 | 1272 | perform_authenticate(&mut connection, &authenticate).await?; |
1271 | 1273 | } |
| 1274 | + Response::Error(Error { error, reason }) => return Err(QueryError::DbError(error, reason)), |
1272 | 1275 | _ => { |
1273 | 1276 | return Err(QueryError::ProtocolError( |
1274 | 1277 | "Unexpected response to STARTUP message", |
|
0 commit comments