mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 02:57:02 +08:00
feat(api_models): add error structs (#532)
Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
#![allow(unused_variables)]
|
||||
use crate::core::errors;
|
||||
|
||||
#[derive(Debug, router_derive::ApiError)]
|
||||
#[derive(Debug, router_derive::ApiError, Clone)]
|
||||
#[error(error_type_enum = StripeErrorType)]
|
||||
pub enum StripeErrorCode {
|
||||
/*
|
||||
@ -529,3 +529,9 @@ impl From<serde_qs::Error> for StripeErrorCode {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl common_utils::errors::ErrorSwitch<StripeErrorCode> for errors::ApiErrorResponse {
|
||||
fn switch(&self) -> StripeErrorCode {
|
||||
self.clone().into()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user