mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 17:47:54 +08:00
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
33 lines
1.1 KiB
Rust
33 lines
1.1 KiB
Rust
use redis_interface as redis;
|
|
use thiserror::Error;
|
|
|
|
#[derive(Debug, Error)]
|
|
pub enum DrainerError {
|
|
#[error("Error in parsing config : {0}")]
|
|
ConfigParsingError(String),
|
|
#[error("Error during redis operation : {0:?}")]
|
|
RedisError(error_stack::Report<redis::errors::RedisError>),
|
|
#[error("Application configuration error: {0}")]
|
|
ConfigurationError(config::ConfigError),
|
|
#[error("Error while configuring signals: {0}")]
|
|
SignalError(String),
|
|
#[error("Error while parsing data from the stream: {0:?}")]
|
|
ParsingError(error_stack::Report<common_utils::errors::ParsingError>),
|
|
#[error("Unexpected error occurred: {0}")]
|
|
UnexpectedError(String),
|
|
}
|
|
|
|
pub type DrainerResult<T> = error_stack::Result<T, DrainerError>;
|
|
|
|
impl From<config::ConfigError> for DrainerError {
|
|
fn from(err: config::ConfigError) -> Self {
|
|
Self::ConfigurationError(err)
|
|
}
|
|
}
|
|
|
|
impl From<error_stack::Report<redis::errors::RedisError>> for DrainerError {
|
|
fn from(err: error_stack::Report<redis::errors::RedisError>) -> Self {
|
|
Self::RedisError(err)
|
|
}
|
|
}
|