javascript - pg doesn't seem to close the connection correctly -


i writing application using node.js , postgresql. when user authenticates hits db check user's password supposedly closes connection db. however, if user enters wrong password , tries again authenticate, error on server console:

uncaught exception... { [error: write epipe] code: 'epipe', errno: 'epipe', syscall: 'write' } error: write epipe 

i believe not closing connection correctly first time. part of script supposed close connection:

query.on('end', function(){     client.end();     if (pass == this.dbpass){         console.log(pass);         console.log(this.dbpass);         return callback (200, "ok", {}, true);     } else {         console.log(pass);         return callback(200, "ok", {}, false);     } }); 

is there way close connection unaware of?


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -