mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
feat(router): Added amount conversion function in core for connector module (#4710)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Hrithikesh <61539176+hrithikesh026@users.noreply.github.com> Co-authored-by: Narayan Bhat <narayan.bhat@juspay.in>
This commit is contained in:
@ -11,6 +11,7 @@ use crate::types::MinorUnit;
|
||||
pub type CustomResult<T, E> = error_stack::Result<T, E>;
|
||||
|
||||
/// Parsing Errors
|
||||
#[allow(missing_docs)] // Only to prevent warnings about struct fields not being documented
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum ParsingError {
|
||||
///Failed to parse enum
|
||||
@ -34,6 +35,21 @@ pub enum ParsingError {
|
||||
/// Failed to parse phone number
|
||||
#[error("Failed to parse phone number")]
|
||||
PhoneNumberParsingError,
|
||||
/// Failed to parse Float value for converting to decimal points
|
||||
#[error("Failed to parse Float value for converting to decimal points")]
|
||||
FloatToDecimalConversionFailure,
|
||||
/// Failed to parse Decimal value for i64 value conversion
|
||||
#[error("Failed to parse Decimal value for i64 value conversion")]
|
||||
DecimalToI64ConversionFailure,
|
||||
/// Failed to parse string value for f64 value conversion
|
||||
#[error("Failed to parse string value for f64 value conversion")]
|
||||
StringToFloatConversionFailure,
|
||||
/// Failed to parse i64 value for f64 value conversion
|
||||
#[error("Failed to parse i64 value for f64 value conversion")]
|
||||
I64ToDecimalConversionFailure,
|
||||
/// Failed to parse String value to Decimal value conversion because `error`
|
||||
#[error("Failed to parse String value to Decimal value conversion because {error}")]
|
||||
StringToDecimalConversionFailure { error: String },
|
||||
}
|
||||
|
||||
/// Validation errors.
|
||||
|
||||
Reference in New Issue
Block a user