mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
fix(router): removed dynamic error messages (#2168)
Co-authored-by: Sahkal Poddar <sahkal.poddar@juspay.in>
This commit is contained in:
@ -102,7 +102,7 @@ pub enum StripeErrorCode {
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "No such resource ID")]
|
||||
ResourceIdNotFound,
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "Merchant connector account with id '{id}' does not exist in our records")]
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "Merchant connector account does not exist in our records")]
|
||||
MerchantConnectorAccountNotFound { id: String },
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "invalid_request", message = "The merchant connector account is disabled")]
|
||||
@ -193,7 +193,7 @@ pub enum StripeErrorCode {
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "", message = "The mandate information is invalid. {message}")]
|
||||
PaymentIntentMandateInvalid { message: String },
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "", message = "The payment with the specified payment_id '{payment_id}' already exists in our records.")]
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "", message = "The payment with the specified payment_id already exists in our records.")]
|
||||
DuplicatePayment { payment_id: String },
|
||||
|
||||
#[error(error_type = StripeErrorType::ConnectorError, code = "", message = "{code}: {message}")]
|
||||
|
||||
@ -140,7 +140,7 @@ pub enum ApiErrorResponse {
|
||||
},
|
||||
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payment method with the specified details already exists in our records")]
|
||||
DuplicatePaymentMethod,
|
||||
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payment with the specified payment_id '{payment_id}' already exists in our records")]
|
||||
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payment with the specified payment_id already exists in our records")]
|
||||
DuplicatePayment { payment_id: String },
|
||||
#[error(error_type = ErrorType::DuplicateRequest, code = "HE_01", message = "The payout with the specified payout_id '{payout_id}' already exists in our records")]
|
||||
DuplicatePayout { payout_id: String },
|
||||
@ -158,7 +158,7 @@ pub enum ApiErrorResponse {
|
||||
PaymentMethodNotFound,
|
||||
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Merchant account does not exist in our records")]
|
||||
MerchantAccountNotFound,
|
||||
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Merchant connector account with id '{id}' does not exist in our records")]
|
||||
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Merchant connector account does not exist in our records")]
|
||||
MerchantConnectorAccountNotFound { id: String },
|
||||
#[error(error_type = ErrorType::ObjectNotFound, code = "HE_02", message = "Business profile with the given id '{id}' does not exist in our records")]
|
||||
BusinessProfileNotFound { id: String },
|
||||
|
||||
@ -135,7 +135,7 @@ impl ErrorSwitch<api_models::errors::types::ApiErrorResponse> for ApiErrorRespon
|
||||
}
|
||||
Self::DuplicatePaymentMethod => AER::BadRequest(ApiError::new("HE", 1, "The payment method with the specified details already exists in our records", None)),
|
||||
Self::DuplicatePayment { payment_id } => {
|
||||
AER::BadRequest(ApiError::new("HE", 1, format!("The payment with the specified payment_id '{payment_id}' already exists in our records"), None))
|
||||
AER::BadRequest(ApiError::new("HE", 1, "The payment with the specified payment_id already exists in our records", Some(Extra {reason: Some(format!("{payment_id} already exists")), ..Default::default()})))
|
||||
}
|
||||
Self::DuplicatePayout { payout_id } => {
|
||||
AER::BadRequest(ApiError::new("HE", 1, format!("The payout with the specified payout_id '{payout_id}' already exists in our records"), None))
|
||||
@ -164,8 +164,8 @@ impl ErrorSwitch<api_models::errors::types::ApiErrorResponse> for ApiErrorRespon
|
||||
Self::MerchantAccountNotFound => {
|
||||
AER::NotFound(ApiError::new("HE", 2, "Merchant account does not exist in our records", None))
|
||||
}
|
||||
Self::MerchantConnectorAccountNotFound { id } => {
|
||||
AER::NotFound(ApiError::new("HE", 2, format!("Merchant connector account with id '{id}' does not exist in our records"), None))
|
||||
Self::MerchantConnectorAccountNotFound {id } => {
|
||||
AER::NotFound(ApiError::new("HE", 2, "Merchant connector account does not exist in our records", Some(Extra {reason: Some(format!("{id} does not exist")), ..Default::default()})))
|
||||
}
|
||||
Self::MerchantConnectorAccountDisabled => {
|
||||
AER::BadRequest(ApiError::new("HE", 3, "The selected merchant connector account is disabled", None))
|
||||
|
||||
Reference in New Issue
Block a user