Using PrismaClientExceptionFilter as a filter for a nestjs gateway in this manner for example:
import { UseFilters } from '@nestjs/common';
import { SubscribeMessage, WebSocketGateway } from '@nestjs/websockets';
import { PrismaClientExceptionFilter } from 'nestjs-prisma';
@UseFilters(PrismaClientExceptionFilter)
@WebSocketGateway()
export class AppGateway {
@SubscribeMessage('message')
handleMessage(client: any, payload: any): string {
return 'Hello world!';
}
}
errors with this in the console:
[Nest] 8884 - 24/11/2023, 22:17:06 ERROR [ExceptionHandler] Nest can't resolve dependencies of the PrismaClientExceptionFilter (?, Object). Please make sure that the argument Object at index [0] is available in the ChatModule context.
Potential solutions:
- Is ChatModule a valid NestJS module?
- If Object is a provider, is it part of the current ChatModule?
- If Object is exported from a separate @Module, is that module imported within ChatModule?
@Module({
imports: [ /* the Module containing Object */ ]
})
nestjs can't inject the first argument of the constructor. I tried the same for a controller and It gives me the same error. Are there any plans to support this?
Using
PrismaClientExceptionFilter
as a filter for a nestjs gateway in this manner for example:errors with this in the console:
nestjs can't inject the first argument of the constructor. I tried the same for a controller and It gives me the same error. Are there any plans to support this?