Skip to content

End event doesn't fire on error #565

Closed
@patriksimek

Description

@patriksimek

node 0.11.12, node-postgres 3.0.1

pg.connect("postgres://...", function(err, client, done) {
    console.log('query');
    var q = client.query("select * from notexistingtable", []);
    q.on('error', function(err) {
        console.log('error');
    });
    q.on('end', function() {
        console.log('done');
    });
});

result in:

query
error

But there is no done reported in console.

Documentation says about End event: "Emitted by the query when all rows have been returned or when an error has been encountered. In either circumstance, the query's execution is finished and it is no longer interacting with the connection."

Work fine in node-postgres 2.8.5.

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