Skip to content

Commit

Permalink
Merge a2579da into 84d253f
Browse files Browse the repository at this point in the history
  • Loading branch information
lotterfriends committed Feb 14, 2020
2 parents 84d253f + a2579da commit 8f07c69
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Expand Up @@ -53,6 +53,7 @@ function createOrDropDatabase(action) {
//disconnect client when all queries are finished
client.on('drain', client.end.bind(client));
client.on('error', function (err) {
client.end();
reject(err);
});
client.connect();
Expand All @@ -63,9 +64,11 @@ function createOrDropDatabase(action) {
var err;
if (pgErr) {
err = new PgError(pgErr);
client.end();
reject(err);
return
}
client.end();
resolve(res);
});
}).nodeify(cb);
Expand Down

0 comments on commit 8f07c69

Please sign in to comment.