1
- use crate :: errors:: { BadQuery , ConnectionPoolError } ;
1
+ use crate :: errors:: ConnectionPoolError ;
2
2
use crate :: network:: { Connection , PoolConfig , VerifiedKeyspaceName } ;
3
3
use crate :: policies:: host_filter:: HostFilter ;
4
4
use crate :: prepared_statement:: TokenCalculationError ;
@@ -204,7 +204,7 @@ impl ClusterState {
204
204
keyspace : & str ,
205
205
table : & str ,
206
206
partition_key : & SerializedValues ,
207
- ) -> Result < Token , BadQuery > {
207
+ ) -> Result < Token , TokenCalculationError > {
208
208
let partitioner = self
209
209
. keyspaces
210
210
. get ( keyspace)
@@ -213,11 +213,7 @@ impl ClusterState {
213
213
. and_then ( PartitionerName :: from_str)
214
214
. unwrap_or_default ( ) ;
215
215
216
- calculate_token_for_partition_key ( partition_key, & partitioner) . map_err ( |err| match err {
217
- TokenCalculationError :: ValueTooLong ( values_len) => {
218
- BadQuery :: ValuesTooLongForKey ( values_len, u16:: MAX . into ( ) )
219
- }
220
- } )
216
+ calculate_token_for_partition_key ( partition_key, & partitioner)
221
217
}
222
218
223
219
/// Access to replicas owning a given token
@@ -255,7 +251,7 @@ impl ClusterState {
255
251
keyspace : & str ,
256
252
table : & str ,
257
253
partition_key : & SerializedValues ,
258
- ) -> Result < Vec < ( Arc < Node > , Shard ) > , BadQuery > {
254
+ ) -> Result < Vec < ( Arc < Node > , Shard ) > , TokenCalculationError > {
259
255
let token = self . compute_token ( keyspace, table, partition_key) ?;
260
256
Ok ( self . get_token_endpoints ( keyspace, table, token) )
261
257
}
0 commit comments