From e66035df7f60f0e4f10189af98406ba7c3b36b61 Mon Sep 17 00:00:00 2001 From: Aleksandr Bukhalo Date: Tue, 5 May 2020 16:34:44 +0300 Subject: [PATCH] fix: wrong telegraf errors handling --- lib/telegraf.provider.ts | 7 +++++-- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/telegraf.provider.ts b/lib/telegraf.provider.ts index 5b21284..58be5b1 100644 --- a/lib/telegraf.provider.ts +++ b/lib/telegraf.provider.ts @@ -21,8 +21,11 @@ export class TelegrafProvider extends Telegraf } async onApplicationBootstrap() { - this.catch((e) => { - this.logger.error(e); + this.catch((err, ctx: Context) => { + this.logger.error( + `Encountered an error for ${ctx.updateType} update type`, + err, + ); }); await this.launch(this.launchOptions); diff --git a/package-lock.json b/package-lock.json index 5029572..fc2dab0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nestjs-telegraf", - "version": "1.2.0", + "version": "1.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 092c30d..1ab75bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nestjs-telegraf", - "version": "1.2.0", + "version": "1.2.1", "description": "Telegraf module for NestJS", "keywords": [ "nest",