Use same onclose listener in sendPayment (#1020)
This is the onclose listener from getInfo. This might also be a potential fix for undefined errors that I am getting. With "undefined errors" I mean that the error itself is literally undefined.
This commit is contained in:
parent
6e75b9d274
commit
9d897e9bf7
|
@ -235,8 +235,12 @@ export function NWCProvider ({ children }) {
|
|||
},
|
||||
onclose (reason) {
|
||||
clearTimeout(timer)
|
||||
reject(new Error(reason))
|
||||
sub?.close()
|
||||
if (!['closed by caller', 'relay connection closed by us'].includes(reason)) {
|
||||
// only log if not closed by us (caller)
|
||||
const msg = 'connection closed: ' + (reason || 'unknown reason')
|
||||
logger.error(msg)
|
||||
reject(new Error(msg))
|
||||
}
|
||||
}
|
||||
})
|
||||
})().catch(reject)
|
||||
|
|
Loading…
Reference in New Issue