mirror of
https://github.com/aljazceru/breez-sdk-docs.git
synced 2025-12-17 13:54:20 +01:00
Wrap promises with try blocks
This commit is contained in:
@@ -2,11 +2,15 @@ import { receivePayment } from '@breeztech/react-native-breez-sdk'
|
||||
|
||||
const exampleReceiveLightningPayment = async () => {
|
||||
// ANCHOR: receive-payment
|
||||
const receivePaymentResponse = await receivePayment({
|
||||
amountMsat: 3_000_000,
|
||||
description: 'Invoice for 3000 sats'
|
||||
})
|
||||
try {
|
||||
const receivePaymentResponse = await receivePayment({
|
||||
amountMsat: 3_000_000,
|
||||
description: 'Invoice for 3000 sats'
|
||||
})
|
||||
|
||||
const invoice = receivePaymentResponse.lnInvoice
|
||||
const invoice = receivePaymentResponse.lnInvoice
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
}
|
||||
// ANCHOR_END: receive-payment
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user