Mysql 从抛出错误节点获取错误消息
我需要在我的数据库中插入一个带有错误的日志错误Mysql 从抛出错误节点获取错误消息,mysql,node.js,try-catch,getmessage,Mysql,Node.js,Try Catch,Getmessage,我需要在我的数据库中插入一个带有错误的日志错误 mysql.query(sql_log, [sucess], function (err, result) { if (err){ mysql.rollback(function() { throw err; }); } }); 我需要获取err.message只是console.log(err)在if条件之后 mysql.query(sql_log, [sucess]
mysql.query(sql_log, [sucess], function (err, result) {
if (err){
mysql.rollback(function() {
throw err;
});
}
});
我需要获取err.message只是console.log(err)代码>在if条件之后
mysql.query(sql_log, [sucess], function (err, result) {
if (err){
console.log(err);
mysql.rollback(function() {
throw err;
});
}});
是的,我知道,但我需要像console.log(err.msg)这样的东西;