Skip to content

Storage errors cause node to exit #389

Open
@FauxFaux

Description

If the storage system throws an error, the exception unwinds back to here:

this.on("document", async ({ handle, isNew }) => {
if (storageSubsystem) {
// Save when the document changes
handle.on("heads-changed", async ({ handle, doc }) => {
await storageSubsystem.saveDoc(handle.documentId, doc)

It's not valid to return a rejected promise from this event handler, as nothing handles that rejected promise. The default unhandledRejection handler is to exit with status 1, so node exits.

I would rather that node didn't exit when there was an error, and some kind of error handler was called, so I can handle or retry said error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions