mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-09-30 12:27:39 +03:00
feat!(): add custom execution context
This commit is contained in:
11
sample/common/filters/telegraf-exception.filter.ts
Normal file
11
sample/common/filters/telegraf-exception.filter.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { ArgumentsHost, Catch, ExceptionFilter } from '@nestjs/common';
|
||||
import { TelegrafArgumentsHost, TelegrafException } from '../../../lib';
|
||||
|
||||
@Catch()
|
||||
export class TelegrafExceptionFilter<T> implements ExceptionFilter {
|
||||
catch(exception: T, host: ArgumentsHost) {
|
||||
const tgHost = TelegrafArgumentsHost.create(host);
|
||||
console.log(tgHost);
|
||||
return exception;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user