Open andriipustovoit opened 5 years ago
This logic has been changed from v0.3.6
.
Currently wechaty-puppet-padpro
does not support one process, multiple wechaty instance well, supporting this use case is in our roadmap, but for now, we don't recommend to do manage bot in this way.
Please try with v0.3.6
or above to see if the issue still exists.
In Nodejs application, I want to start multiple Wechaty PuppetPadpro bot instances dynamically based on an HTTP request. A token for a new instance of Wechaty bot is passed along with the request. But if for some reason not a valid token is passed to Wechaty bot, library prints error and calls process
process.exit(-1);
which stops the whole Nodejs process with multiple running bot instances. Can somehow I modify Wechaty bot behavior to not performprocess.exit(-1);
but just print error instead?I tried to catch errors from
bot.start().catch(error => console.log("error"));
tried to wrap into Domain to catch errors, but nothing seems to work.Message that I receive:
I expect bot just emits error event on an invalid token, but instead, bot terminates Nodejs process.
P.S. thought about posting question to stack overflow as was recommended but got an error on:
Creating the new tag 'wechaty' requires at least 1500 reputation. Try something from the existing tags list instead.