#![allow(dead_code)]
use thiserror::Error;
#[derive(Debug, Error)]
pub enum StreamError {
#[error("connection error: {0}")]
Connection(String),
#[error("timeout: {0}")]
Timeout(String),
#[error("configuration error: {0}")]
Config(String),
#[error("serialization error: {0}")]
Serde(String),
#[error("topic not found: {0}")]
TopicNotFound(String),
#[error("partition not found: {topic}:{partition}")]
PartitionNotFound { topic: String, partition: u32 },
#[error("group not found: {0}")]
GroupNotFound(String),
#[error("consumer not found: {consumer} in group {group}")]
ConsumerNotFound { group: String, consumer: String },
#[error("offset out of range: {topic}:{partition}@{offset}")]
OffsetOutOfRange {
topic: String,
partition: u32,
offset: u64,
},
#[error("transaction error: {0}")]
Transaction(String),
#[error("authorization error: {0}")]
Authorization(String),
#[error("server error: {0}")]
Server(String),
#[error("transport error: {0}")]
Transport(#[from] tonic::transport::Error),
#[error("gRPC status: {0}")]
Status(#[from] tonic::Status),
#[error("protocol error: {0}")]
Protocol(String),
#[error("internal error: {0}")]
Internal(String),
}