fix: wrong telegraf errors handling

This commit is contained in:
Aleksandr Bukhalo 2020-05-05 16:34:44 +03:00
parent 5eb3b5abe8
commit e66035df7f
3 changed files with 7 additions and 4 deletions

View File

@ -21,8 +21,11 @@ export class TelegrafProvider extends Telegraf<Context>
}
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);

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "nestjs-telegraf",
"version": "1.2.0",
"version": "1.2.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "nestjs-telegraf",
"version": "1.2.0",
"version": "1.2.1",
"description": "Telegraf module for NestJS",
"keywords": [
"nest",