Catch previously uncaught error inside CB
This commit is contained in:
parent
879547c101
commit
e236cafe05
1 changed files with 8 additions and 8 deletions
|
|
@ -2725,16 +2725,16 @@ module.exports = async (
|
||||||
: gun
|
: gun
|
||||||
keys.forEach(key => (node = node.get(key)))
|
keys.forEach(key => (node = node.get(key)))
|
||||||
|
|
||||||
return new Promise(res => {
|
return new Promise((res, rej) => {
|
||||||
const listener = async data => {
|
const listener = data => {
|
||||||
if (publicKeyForDecryption) {
|
if (publicKeyForDecryption) {
|
||||||
res(
|
GunWriteRPC.deepDecryptIfNeeded(
|
||||||
await GunWriteRPC.deepDecryptIfNeeded(
|
|
||||||
data,
|
data,
|
||||||
publicKeyForDecryption,
|
publicKeyForDecryption,
|
||||||
epubForDecryption
|
epubForDecryption
|
||||||
)
|
)
|
||||||
)
|
.then(res)
|
||||||
|
.catch(rej)
|
||||||
} else {
|
} else {
|
||||||
res(data)
|
res(data)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue