Node js + mysql2: Should I check for errors in both connection.on('error', fn1) and connection.connect(fn2), or one of these checks is sufficient?

后端 未结 0 556
滥情空心
滥情空心 2020-12-31 18:49

My current code is:

const mysql = require(\'mysql2\');
function createConnection() {
return new Promise((res, rej) => {
    let connection = mysql.createCo         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题