diff --git a/src/handlers/workflow-proxy.ts b/src/handlers/workflow-proxy.ts index 95e43b9..2b50556 100644 --- a/src/handlers/workflow-proxy.ts +++ b/src/handlers/workflow-proxy.ts @@ -32,7 +32,6 @@ export function proxyWorkflowCallbacks(context: Context): ProxyCallbacks { for (const r of res) { if (r.status !== 200) { await bubbleUpErrorComment(context, new Error(r.reason)); - await exit(1); } } await exit(0); diff --git a/src/types/plugin-context-single.ts b/src/types/plugin-context-single.ts index e7cd9e7..71700ec 100644 --- a/src/types/plugin-context-single.ts +++ b/src/types/plugin-context-single.ts @@ -85,12 +85,15 @@ export class PluginContext { async getTelegramEventOctokit(): Promise { let octokit: RestOctokitFromApp | null = null; - await this.getApp().eachInstallation(async (installation) => { - if (installation.installation.account?.login === this.config.storageOwner) { - octokit = installation.octokit; - } - }); - + try { + await this.getApp().eachInstallation(async (installation) => { + if (installation.installation.account?.login === this.config.storageOwner) { + octokit = installation.octokit; + } + }); + } catch (er) { + logger.error("Error initializing octokit in getTelegramEventOctokit", { er }); + } if (!octokit) { throw new Error("Octokit could not be initialized"); } diff --git a/src/types/telegram-bot-single.ts b/src/types/telegram-bot-single.ts index cfdd6ad..ef5b437 100644 --- a/src/types/telegram-bot-single.ts +++ b/src/types/telegram-bot-single.ts @@ -23,6 +23,10 @@ export class TelegramBotSingleton { const octokit = await PluginContext.getInstance().getTelegramEventOctokit(); + if (!octokit) { + throw new Error("octokit could not be initialized"); + } + if (!TelegramBotSingleton._instance) { TelegramBotSingleton._instance = new TelegramBotSingleton(); try {