Skip to content

Commit

Permalink
Handle bot launch error so the app won't crash
Browse files Browse the repository at this point in the history
  • Loading branch information
mfahmialkautsar committed Sep 27, 2023
1 parent 5f6d1d8 commit 52dfe5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/create-bot-factory.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function createBotFactory(
bot.use(...(options.middlewares ?? []));

if (options.launchOptions !== false) {
bot.launch(options.launchOptions);
bot.launch(options.launchOptions).catch((err: Error) => console.error('Bot launch error. It won\'t be available until the app restarts.', err));
}

return bot;
Expand Down

0 comments on commit 52dfe5f

Please sign in to comment.