#Catch Scheduler Error globally

3 messages · Page 1 of 1 (latest)

desert magnet
#

Hello I'm using a method that looks like this:

@Interval(1000)
async pollData() {
return await fetchData()
}

I declared a global exception filter via useGlobalFilters in my main.ts , I added it via APP_FILTER in my app.module.ts or even the module having this function implemented and I used @UseFilters(new AllExceptionFilter()) but the Scheduler error seems never to get caught there instead somewhere else in the Nest framework. How can I catch the error globally? I don't want to have specific catch implementation in the method it self.

outer dagger
#

there's no nestjs abstraction to that
you can implement it in several ways