mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
build(deps): update dependencies (#4268)
This commit is contained in:
@ -12,30 +12,6 @@ use crate::{errors as storage_errors, store::errors::DatabaseError};
|
||||
|
||||
pub type ApplicationResult<T> = Result<T, ApplicationError>;
|
||||
|
||||
macro_rules! impl_error_display {
|
||||
($st: ident, $arg: tt) => {
|
||||
impl Display for $st {
|
||||
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(
|
||||
fmt,
|
||||
"{{ error_type: {:?}, error_description: {} }}",
|
||||
self, $arg
|
||||
)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
macro_rules! impl_error_type {
|
||||
($name: ident, $arg: tt) => {
|
||||
#[derive(Debug)]
|
||||
pub struct $name;
|
||||
|
||||
impl_error_display!($name, $arg);
|
||||
|
||||
impl std::error::Error for $name {}
|
||||
};
|
||||
}
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum StorageError {
|
||||
#[error("DatabaseError: {0:?}")]
|
||||
@ -176,8 +152,6 @@ impl RedisErrorExt for error_stack::Report<RedisError> {
|
||||
}
|
||||
}
|
||||
|
||||
impl_error_type!(EncryptionError, "Encryption error");
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum ApplicationError {
|
||||
// Display's impl can be overridden by the attribute error marco.
|
||||
@ -210,12 +184,6 @@ impl From<std::io::Error> for ApplicationError {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ring::error::Unspecified> for EncryptionError {
|
||||
fn from(_: ring::error::Unspecified) -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ConfigError> for ApplicationError {
|
||||
fn from(err: ConfigError) -> Self {
|
||||
Self::ConfigurationError(err)
|
||||
|
||||
Reference in New Issue
Block a user