Skip to content

Handle errors in event emitters #257

@mweidner037

Description

@mweidner037

Currently, EventEmitter traps any errors emitted by an event handler, merely logging them to console.error. We should consider letting these errors just propagate normally. That way, errors caused by local ops (including parent CRDT logic in an event listener) propagate immediately and prevent a message from being sent, and mocha can see these errors during tests.

My concern is that an error in an "irrelevant" event handler will then interfere with the other handlers and the event emitter. But perhaps this is not really an issue, especially since events are often handled at most once (either by the parent CRDT or by the GUI component rendering the CRDT). And you can always "opt out" using a top level try-catch in your own event handlers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions