亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - An error keeps appearing when using koa mysql2
大家講道理
大家講道理 2017-06-12 09:20:20
0
2
994

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.

大家講道理
大家講道理

光陰似箭催人老,日月如移越少年。

reply all(2)
phpcn_u1582

No caught exceptions. Use

try ... catch ...
扔個三星炸死你

Add two ways to manually close the connection after an exception

connection.end(function(err) {
  // The connection is terminated now
});
--------------------

connection.destroy();
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template