mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-18 19:23:40 +00:00
Catch signature errors
This commit is contained in:
parent
1a401ff20f
commit
6722131c8f
@ -174,7 +174,12 @@ class PublishableEvent {
|
||||
this.event = {kind, content, tags, pubkey, created_at: createdAt}
|
||||
}
|
||||
getSignedEvent() {
|
||||
return keys.sign(this.event)
|
||||
try {
|
||||
return keys.sign(this.event)
|
||||
} catch (e) {
|
||||
console.log(this.event)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
async publish(relays, onProgress = null, verb = "EVENT") {
|
||||
const event = await this.getSignedEvent()
|
||||
|
@ -287,7 +287,13 @@ async function subscribe({relays, filter, onEvent, onEose}: SubscribeOpts) {
|
||||
|
||||
seen.add(e.id)
|
||||
|
||||
if (!verifySignature(e)) {
|
||||
try {
|
||||
if (!verifySignature(e)) {
|
||||
return
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user