forked from Kieran/snort
tiny cleanup
This commit is contained in:
parent
6daa75b21c
commit
a34e6960d2
@ -9,7 +9,6 @@ import { EventEmitter } from "./emitter"
|
|||||||
* A nostr client.
|
* A nostr client.
|
||||||
*
|
*
|
||||||
* TODO Document the events here
|
* TODO Document the events here
|
||||||
* TODO Move all this to that file and add the newListener and removeListener events there as well
|
|
||||||
*/
|
*/
|
||||||
export class Nostr extends EventEmitter {
|
export class Nostr extends EventEmitter {
|
||||||
// TODO NIP-44 AUTH, leave this for later
|
// TODO NIP-44 AUTH, leave this for later
|
||||||
@ -66,12 +65,7 @@ export class Nostr extends EventEmitter {
|
|||||||
} else if (msg.kind === IncomingKind.Notice) {
|
} else if (msg.kind === IncomingKind.Notice) {
|
||||||
this.emit("notice", msg.notice, this)
|
this.emit("notice", msg.notice, this)
|
||||||
} else {
|
} else {
|
||||||
const err = new ProtocolError(`invalid message ${msg}`)
|
throw new ProtocolError(`invalid message ${msg}`)
|
||||||
try {
|
|
||||||
this.emit("error", err, this)
|
|
||||||
} catch (err) {
|
|
||||||
// Don't propagate errors from the error callback.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.emit("error", err, this)
|
this.emit("error", err, this)
|
||||||
|
Loading…
Reference in New Issue
Block a user