Skip to content

Commit fd0131a

Browse files
committed
cass_error: BadKeyspaceName -> UNABLE_TO_SET_KEYSPACE
This seems to be the most natural mapping for the `BadKeyspaceName` error.
1 parent 3f9351b commit fd0131a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scylla-rust-wrapper/src/cass_error.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,11 @@ impl ToCassError for MetadataError {
240240
impl ToCassError for BadKeyspaceName {
241241
fn to_cass_error(&self) -> CassError {
242242
match self {
243-
BadKeyspaceName::Empty => CassError::CASS_ERROR_LAST_ENTRY,
244-
BadKeyspaceName::TooLong(_string, _usize) => CassError::CASS_ERROR_LAST_ENTRY,
245-
BadKeyspaceName::IllegalCharacter(_string, _char) => CassError::CASS_ERROR_LAST_ENTRY,
243+
BadKeyspaceName::Empty
244+
| BadKeyspaceName::TooLong(_, _)
245+
| BadKeyspaceName::IllegalCharacter(_, _) => {
246+
CassError::CASS_ERROR_LIB_UNABLE_TO_SET_KEYSPACE
247+
}
246248
// non_exhaustive
247249
_ => CassError::CASS_ERROR_LAST_ENTRY,
248250
}

0 commit comments

Comments
 (0)