I used the koa project generated by koa-generator. The routing part is written as follows:
router.get("/test",async (ctx, next) =>{
});
Mysql needs to be used. I chose the promise form of mysql2. Directly refer to the following link:
https://github.com/sidorares/...
But every once in a while, an error will be reported:
events.js:163
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at exports._errnoException (util.js:1050:11)
at TCP.onread (net.js:582:26)
I am here to ask about the reason for this error and how to solve it in this case. Thank you.
扔个三星炸死你2017-06-12 09:22:20
Add two ways to manually close the connection after an exception
connection.end(function(err) {
// The connection is terminated now
});
--------------------
connection.destroy();