Skip to content

Commit 468b654

Browse files
committed
Updated related to Payment ErrorCodes in IndyCli
Signed-off-by: artem.ivanov <[email protected]>
1 parent 0908307 commit 468b654

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

cli/src/commands/payment_address.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ pub mod list_command {
9797

9898
pub fn handle_payment_error(err: ErrorCode, payment_method: Option<&str>) {
9999
match err {
100-
ErrorCode::UnknownPaymentMethod => println_err!("Unknown payment method {}", payment_method.unwrap_or("")),
101-
ErrorCode::IncompatiblePaymentError => println_err!("Different payment methods were specified"),
100+
ErrorCode::PaymentUnknownMethodError => println_err!("Unknown payment method {}", payment_method.unwrap_or("")),
101+
ErrorCode::PaymentIncompatibleMethodsError => println_err!("Different payment methods were specified"),
102+
ErrorCode::PaymentInsufficientFundsError => println_err!("Insufficient funds on inputs"),
102103
err => println_err!("Indy SDK error occurred {:?}", err)
103104
}
104105
}

cli/src/libindy/mod.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,13 @@ pub enum ErrorCode
139139
DidAlreadyExistsError = 600,
140140

141141
// Unknown payment method was given
142-
UnknownPaymentMethod = 700,
142+
PaymentUnknownMethodError = 700,
143143

144144
//No method were scraped from inputs/outputs or more than one were scraped
145-
IncompatiblePaymentError = 701
145+
PaymentIncompatibleMethodsError = 701,
146+
147+
// Insufficient funds on inputs
148+
PaymentInsufficientFundsError = 702,
146149
}
147150

148151
impl ErrorCode {
@@ -191,8 +194,9 @@ impl ErrorCode {
191194
AnoncredsCredDefAlreadyExistsError => "Credential definition already exists",
192195
UnknownCryptoTypeError => "Unknown format of DID entity keys",
193196
DidAlreadyExistsError => "Did already exists",
194-
UnknownPaymentMethod => "Unknown payment method was given",
195-
IncompatiblePaymentError => "Multiple different payment methods were specified",
197+
PaymentUnknownMethodError => "Unknown payment method was given",
198+
PaymentIncompatibleMethodsError => "Multiple different payment methods were specified",
199+
PaymentInsufficientFundsError => "Insufficient funds on inputs",
196200
}
197201
}
198202
}

0 commit comments

Comments
 (0)