View difference between Paste ID: JhyvFhAS and e8AqvjuA
SHOW: | | - or go back to the newest paste.
1
pool.getConnectionAsync().then(function(connection) {
2
    //Use `connection` to do query
3
    connection.queryAsync("SELECT * FROM table").spread(function(rows, fields){
4
        //Handle successful query
5
    })
6-
    .catch(function(){
6+
    .catch(function(e) {
7
        //Handle error
8
    })
9
        //In either case, release connection
10
    .finally(function(){
11
        connection.release();
12
    })
13
});