catch decrypt err
This commit is contained in:
parent
f2b42749b6
commit
75d2750a8f
1 changed files with 9 additions and 1 deletions
|
|
@ -166,7 +166,15 @@ export default class Handler {
|
||||||
const startAtMs = Date.now()
|
const startAtMs = Date.now()
|
||||||
const startAtNano = process.hrtime.bigint().toString()
|
const startAtNano = process.hrtime.bigint().toString()
|
||||||
const decoded = decodePayload(e.content)
|
const decoded = decodePayload(e.content)
|
||||||
const content = await decryptData(decoded, getSharedSecret(app.privateKey, e.pubkey))
|
let content = ""
|
||||||
|
try {
|
||||||
|
|
||||||
|
content = await decryptData(decoded, getSharedSecret(app.privateKey, e.pubkey))
|
||||||
|
} catch (e: any) {
|
||||||
|
this.log(ERROR, "failed to decrypt event", e.message)
|
||||||
|
return
|
||||||
|
|
||||||
|
}
|
||||||
this.eventCallback({ id: eventId, content, pub: e.pubkey, appId: app.appId, startAtNano, startAtMs, kind: e.kind })
|
this.eventCallback({ id: eventId, content, pub: e.pubkey, appId: app.appId, startAtNano, startAtMs, kind: e.kind })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue