Skip to content

Commit cd75dd5

Browse files
committed
f Add InvoiceRequestCreationFailed error
1 parent 8a2abe5 commit cd75dd5

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

bindings/ldk_node.udl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ enum NodeError {
134134
"OnchainTxCreationFailed",
135135
"ConnectionFailed",
136136
"InvoiceCreationFailed",
137+
"InvoiceRequestCreationFailed",
137138
"OfferCreationFailed",
138139
"PaymentSendingFailed",
139140
"ProbeSendingFailed",

src/error.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ pub enum Error {
1313
ConnectionFailed,
1414
/// Invoice creation failed.
1515
InvoiceCreationFailed,
16+
/// Invoice request creation failed.
17+
InvoiceRequestCreationFailed,
1618
/// Offer creation failed.
1719
OfferCreationFailed,
1820
/// Sending a payment has failed.
@@ -91,6 +93,7 @@ impl fmt::Display for Error {
9193
},
9294
Self::ConnectionFailed => write!(f, "Network connection closed."),
9395
Self::InvoiceCreationFailed => write!(f, "Failed to create invoice."),
96+
Self::InvoiceRequestCreationFailed => write!(f, "Failed to create invoice request."),
9497
Self::OfferCreationFailed => write!(f, "Failed to create offer."),
9598
Self::PaymentSendingFailed => write!(f, "Failed to send the given payment."),
9699
Self::ProbeSendingFailed => write!(f, "Failed to send the given payment probe."),

src/payment/bolt12.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl Bolt12Payment {
105105
Ok(payment_id)
106106
},
107107
Err(e) => {
108-
log_error!(self.logger, "Failed to send payment: {:?}", e);
108+
log_error!(self.logger, "Failed to send invoice request: {:?}", e);
109109
match e {
110110
Bolt12SemanticError::DuplicatePaymentId => Err(Error::DuplicatePayment),
111111
_ => {
@@ -123,7 +123,7 @@ impl Bolt12Payment {
123123
status: PaymentStatus::Failed,
124124
};
125125
self.payment_store.insert(payment)?;
126-
Err(Error::PaymentSendingFailed)
126+
Err(Error::InvoiceRequestCreationFailed)
127127
},
128128
}
129129
},

0 commit comments

Comments
 (0)