-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
Description
Hi team,
I am quite new to nodejs.
I searched the issues and not found the same, hence come to create a new issue.
I already added on 'error' function, like this:
con.on('error', function(err){
console.log(err.code);
});
But whenever MySQL error happens like selecting non-exists table, my App always crashes.
select * from not_exists_table
/home/user/my-project/node_modules/mysql/lib/protocol/Parser.js:78
throw err; // Rethrow non-MySQL errors
^
Error:
ER_NO_SUCH_TABLE: Table 'my-database.not_exists_table' doesn't exist
Don't know how to make App don't crash when MySQL error happens.
Thanks,
HoHo