[core] WEBJS - handle possible stuck STARTING

fix #586
This commit is contained in:
devlikepro committed 2024-10-16 13:53:14 +07:00
1 parent 18536330ce
commit 10e2c4bbd4
1 file changed
+6 -1
+6 -1
View File
@@ -230,7 +230,12 @@ export class WhatsappSessionWebJSCore extends WhatsappSession {
async start() {
this.status = WAHASessionStatus.STARTING;
await this.init();
await this.init().catch((err) => {
this.logger.error('Failed to start the client');
this.logger.error(err, err.stack);
this.status = WAHASessionStatus.FAILED;
this.restartClient();
});
return this;
}