errors: add an error for not being able to allocate stream ids
@@ -36,6 +36,9 @@ pub enum QueryError {
#[error("Too many orphaned stream ids: {0}")]
TooManyOrphanedStreamIds(u16),
+
+ #[error("Unable to allocate stream id")]
+ UnableToAllocStreamId,
}
/// An error sent from the database in response to a query
@@ -282,6 +285,9 @@ pub enum NewSessionError {
#[error("Too many orphaned stream ids: {0}")]
TooManyOrphanedStreamIds(u16),
+
+ #[error("Unable to allocate stream id")]
+ UnableToAllocStreamId,
}
/// Invalid keyspace name given to `Session::use_keyspace()`
@@ -348,6 +354,7 @@ impl From<QueryError> for NewSessionError {
QueryError::TooManyOrphanedStreamIds(ids) => {
NewSessionError::TooManyOrphanedStreamIds(ids)
}
+ QueryError::UnableToAllocStreamId => NewSessionError::UnableToAllocStreamId,
}
}
}
