mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-29 10:10:00 +02:00
error handling
This commit is contained in:
@ -1448,7 +1448,12 @@
|
|||||||
try {
|
try {
|
||||||
const spendableProofs = proofs.filter(p => !p.reserved)
|
const spendableProofs = proofs.filter(p => !p.reserved)
|
||||||
if (this.sumProofs(spendableProofs) < amount) {
|
if (this.sumProofs(spendableProofs) < amount) {
|
||||||
throw new Error('balance too low.')
|
this.$q.notify({
|
||||||
|
timeout: 5000,
|
||||||
|
type: 'warning',
|
||||||
|
message: 'Balance too low'
|
||||||
|
})
|
||||||
|
throw Error('balance too low.')
|
||||||
}
|
}
|
||||||
let {fristProofs, scndProofs} = await this.split(
|
let {fristProofs, scndProofs} = await this.split(
|
||||||
spendableProofs,
|
spendableProofs,
|
||||||
@ -1591,6 +1596,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
sendTokens: async function () {
|
sendTokens: async function () {
|
||||||
|
try {
|
||||||
// keep firstProofs, send scndProofs
|
// keep firstProofs, send scndProofs
|
||||||
let {fristProofs, scndProofs} = await this.splitToSend(
|
let {fristProofs, scndProofs} = await this.splitToSend(
|
||||||
this.proofs,
|
this.proofs,
|
||||||
@ -1609,6 +1615,11 @@
|
|||||||
})
|
})
|
||||||
this.storehistoryTokens()
|
this.storehistoryTokens()
|
||||||
this.checkTokenSpendableWorker()
|
this.checkTokenSpendableWorker()
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
checkFees: async function (payment_request) {
|
checkFees: async function (payment_request) {
|
||||||
const payload = {
|
const payload = {
|
||||||
@ -1794,7 +1805,7 @@
|
|||||||
if (verbose) {
|
if (verbose) {
|
||||||
this.$q.notify({
|
this.$q.notify({
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
color: 'gray',
|
color: 'grey',
|
||||||
message: 'Token still pending'
|
message: 'Token still pending'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user