First off I wanted to thank those of you who have helped me up to this point. I have a mostly functional Twtich chat bot now thanks to some of you. The last bug I am trying to handle is proving difficult for me though. I have randomly been getting the following:events.js:141 Error: read ECONNRESETI understand that this is most likey an error in my request (server timeout, etc). The problem I have run into is that when it happens my app dies and I have to restart it. I have seen a few examples of how to catch the error, but I'm not entirely sure how to alter my code to catch the error, log it, and carry on like nothing happened.http://ift.tt/2h1cw2q thought the pastebin would make reading what I have a little easier. I have a function that is run every few minutes. The function will make an API call in the form of a promise, and upon return the 'then' is processed. The API call was abstracted out of the function because I have a couple of different api calls that I make. They all have different URL's though.Again those of you who have helped me up to this point, thank you so much.
Submitted December 08, 2016 at 07:05PM by azazael13
No comments:
Post a Comment