Skip to content
This repository was archived by the owner on Dec 30, 2019. It is now read-only.
This repository was archived by the owner on Dec 30, 2019. It is now read-only.

pool.on('error') Documentation Inaccurate #138

@jerroydmoore

Description

@jerroydmoore

Greetings everyone,

I believe the documentation for pool.on('error') is inaccurate/incomplete.

The documentation directs users to "handle this in the same way you would treat process.on('uncaughtException')". The uncaughtException event discourages users from recovering the application: "Unhandled exceptions inherently mean that an application is in an undefined state. Attempting to resume application code without properly recovering from the exception can cause additional unforeseen and unpredictable issues."

After reading through brianc/node-postgres#1075 and brianc/node-postgres#1558. @charmander briefly mentions that pg.Pool will handle reconnecting pg.Client after restarting Postgres: "A pg.Pool will handle this for you, even if you never want more than one client."

Given that pg.Pool can recover from client errors, I think this should be included in the documentation about error handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions