mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-31 01:57:45 +08:00
refactor: extract email validation and PII utils to common_utils crate (#72)
This commit is contained in:
@ -5,7 +5,7 @@ pub(crate) mod utils;
|
||||
use std::fmt::Display;
|
||||
|
||||
use actix_web::{body::BoxBody, http::StatusCode, HttpResponse, ResponseError};
|
||||
pub use common_utils::errors::{CustomResult, ParsingError};
|
||||
pub use common_utils::errors::{CustomResult, ParsingError, ValidationError};
|
||||
use config::ConfigError;
|
||||
use error_stack;
|
||||
pub use redis_interface::errors::RedisError;
|
||||
@ -409,16 +409,6 @@ error_to_process_tracker_error!(
|
||||
ProcessTrackerError::EValidationError(error_stack::Report<ValidationError>)
|
||||
);
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum ValidationError {
|
||||
#[error("Missing required field: {field_name}")]
|
||||
MissingRequiredField { field_name: String },
|
||||
#[error("Incorrect value provided for field: {field_name}")]
|
||||
IncorrectValueProvided { field_name: &'static str },
|
||||
#[error("{message}")]
|
||||
InvalidValue { message: String },
|
||||
}
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum WebhooksFlowError {
|
||||
#[error("Merchant webhook config not found")]
|
||||
|
||||
Reference in New Issue
Block a user