ds_event_stream_rs_sdk/utils/
error.rs

1//! Utils error module.
2//!
3//! This module contains error types specific to administrative utility operations.
4
5use thiserror::Error;
6
7// region: --> UtilsError
8
9/// Errors that can occur during administrative utility operations.
10///
11/// This enum covers all possible errors when performing admin operations like
12/// listing topics, fetching metadata, or managing Kafka cluster resources.
13#[derive(Error, Debug)]
14pub enum UtilsError {
15    /// Kafka client or operation errors
16    #[error("Kafka error: {0}")]
17    Kafka(#[from] rdkafka::error::KafkaError),
18
19    /// Requested topic was not found
20    #[error("Topic not found: {topic_name} for clientId: {client_id}")]
21    TopicNotFound { topic_name: String, client_id: String },
22
23    /// No topics found for the client
24    #[error("No topics found for clientId: {client_id}")]
25    TopicsNotFound { client_id: String },
26
27    /// Regex error
28    #[error("Regex error: {0}")]
29    Regex(#[from] regex::Error),
30}
31
32// endregion: --> UtilsError