Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage errors cause node to exit #389

Open
FauxFaux opened this issue Sep 28, 2024 · 0 comments
Open

Storage errors cause node to exit #389

FauxFaux opened this issue Sep 28, 2024 · 0 comments

Comments

@FauxFaux
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant