Wrap promises with try blocks

This commit is contained in:
Ross Savage
2024-02-06 20:25:50 +01:00
parent 0379597d5e
commit aec144693d
17 changed files with 275 additions and 145 deletions

View File

@@ -2,12 +2,20 @@ import { registerWebhook } from '@breeztech/react-native-breez-sdk'
const webhook = async () => {
// ANCHOR: register-webook
await registerWebhook('https://yourapplication.com')
try {
await registerWebhook('https://yourapplication.com')
} catch (err) {
console.error(err)
}
// ANCHOR_END: register-webook
}
const paymentWebhook = async () => {
// ANCHOR: register-payment-webook
await registerWebhook('https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>')
try {
await registerWebhook('https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>')
} catch (err) {
console.error(err)
}
// ANCHOR_END: register-payment-webook
}