@@ -75,9 +75,12 @@ impl UnifiedQrPayment {
7575 /// - `expiry_sec`: The expiration time for the payment, specified in seconds.
7676 ///
7777 /// Returns a payable URI that can be used to request and receive a payment of the amount
78- /// given. In case of an error, the function returns `Error::WalletOperationFailed`for on-chain
79- /// address issues, `Error::InvoiceCreationFailed` for BOLT11 invoice issues, or
80- /// `Error::OfferCreationFailed` for BOLT12 offer issues.
78+ /// given. The URI will almost always contain at least the on-chain address, and may additionally
79+ /// contain a BOLT11 invoice and/or BOLT12 offer if they were successfully generated.
80+ ///
81+ /// Errors during invoice or offer generation are logged but don't prevent the URI generation,
82+ /// allowing for graceful degradation of functionality. Only complete failure to generate
83+ /// the on-chain address will result in an error return (`Error::WalletOperationFailed`).
8184 ///
8285 /// The generated URI can then be given to a QR code library.
8386 ///
@@ -95,7 +98,7 @@ impl UnifiedQrPayment {
9598 Ok ( offer) => Some ( offer) ,
9699 Err ( e) => {
97100 log_error ! ( self . logger, "Failed to create offer: {}" , e) ;
98- return Err ( Error :: OfferCreationFailed ) ;
101+ None
99102 } ,
100103 } ;
101104
@@ -111,7 +114,7 @@ impl UnifiedQrPayment {
111114 Ok ( invoice) => Some ( invoice) ,
112115 Err ( e) => {
113116 log_error ! ( self . logger, "Failed to create invoice {}" , e) ;
114- return Err ( Error :: InvoiceCreationFailed ) ;
117+ None
115118 } ,
116119 } ;
117120
0 commit comments