Hi everyone, I’m new to Nodejs and I don’t know how to catch exception in this case:
I have an error in my query but catch cannot log the error and continue to do other things until the app crash (I use module mysql2).
try {
var xx = await connection.execute(`UPDAT Products SET quantity=(SELECT * FROM (SELECT quantity FROM Products WHERE id=${id[index]}) AS quantity) - ${quantities[index]} WHERE id=${id[index]};`);
}
catch (err) {
console.log(err);
}
Could you please point out for me if I miss something? Thank you very much