Open abhishekchotaliya opened 6 years ago
That does look like an issue. The first error should be emitted back up so as to be caught by your code:
botmaster.on('error', (bot, err) => {
console.log(bot.type);
console.log(err.stack);
});
But it seems like it isn't. If you could write a test to be able to repeatedly get this error, that would allow us to see where (and why) the error isn't getting emitted back up to the botmaster EventEmitter and we should be able to fix this from there. Maybe even something you could find out yourself as you test this.
For some inspiration on how to write tests, check out the tests folder. From there, it should be much easier to fix the issue.
Cheers
In my application, I am generating access token with the api, which has a lifespan of around 2 hours.
After that access token expires, If I start the botmaster, then it is throwing following error:
and after that, I am continuously getting this error when anyone sends any messages to my facebook bot(which is linked to botmaster)
Now, I know how to fix this access token issue. But, the problem is that I am not able to capture this error in my code. Seems like the error message is not coming to my incoming middleware or main botmaster file (where we configure all the channels), and it is getting resolved in the botmaster/botmaster-messenger only.
I've also tried to capture error using these event listeners. but still no luck.