Skip to content

How to globally override catch function? #908

Answered by evilsprut
Khuzha asked this question in Q&A
Discussion options

You must be logged in to vote

You can get Telegraf instance anywhere in you app with @InjectBot() decorator, or get it in main.ts:

// main.ts
const bot = app.get(getBotToken());
bot.catch(e => console.error(e));

Also you can use ExeptionFilter's.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by evilsprut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #894 on August 24, 2022 13:51.