mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 04:04:43 +08:00
feat(errors): add GenericDuplicateError inApiErrorResponse (#1792)
This commit is contained in:
committed by
GitHub
parent
04c3de73a5
commit
7f947169fe
@ -91,6 +91,9 @@ pub enum StripeErrorCode {
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "{message}")]
|
||||
GenericNotFoundError { message: String },
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "duplicate_resource", message = "{message}")]
|
||||
GenericDuplicateError { message: String },
|
||||
|
||||
#[error(error_type = StripeErrorType::InvalidRequestError, code = "resource_missing", message = "No such merchant account")]
|
||||
MerchantAccountNotFound,
|
||||
|
||||
@ -411,6 +414,9 @@ impl From<errors::ApiErrorResponse> for StripeErrorCode {
|
||||
errors::ApiErrorResponse::GenericNotFoundError { message } => {
|
||||
Self::GenericNotFoundError { message }
|
||||
}
|
||||
errors::ApiErrorResponse::GenericDuplicateError { message } => {
|
||||
Self::GenericDuplicateError { message }
|
||||
}
|
||||
// parameter unknown, invalid request error // actually if we type wrong values in address we get this error. Stripe throws parameter unknown. I don't know if stripe is validating email and stuff
|
||||
errors::ApiErrorResponse::InvalidDataFormat {
|
||||
field_name,
|
||||
@ -607,6 +613,7 @@ impl actix_web::ResponseError for StripeErrorCode {
|
||||
| Self::PaymentIntentMandateInvalid { .. }
|
||||
| Self::PaymentIntentUnexpectedState { .. }
|
||||
| Self::DuplicatePayment { .. }
|
||||
| Self::GenericDuplicateError { .. }
|
||||
| Self::IncorrectConnectorNameGiven
|
||||
| Self::ResourceMissing { .. }
|
||||
| Self::FileValidationFailed
|
||||
|
||||
Reference in New Issue
Block a user