Closed aswin567 closed 1 month ago
Thank you for taking the time to submit your report! From the looks of it, this could be better discussed on our Discord. If you haven't already, please join here and send a new post in the # 🐈 nestjs-help forum. Make sure to include a link to this issue, so you don't need to write it all again. We have a large community of helpful members, who will assist you in getting this to work.
Is there an existing issue for this?
Current behavior
Issue
I am using fastify in my nest js application. The fastify adapter is used in the main.ts for the application. and customeExceptionFilter is added to a common moule and that module is imported in the app module of the respective application. The duty of the customeExceptionFilter is to catch the error and send its as a common error response. The current problem is the customeExceptionFilter is getting triggered but inside that instead of fastifyReply as response I am getting the node js native Server response. But the application working fine as expected (rest api aplication)
But this customeExceptionFilter make me feel like the fastify adpater isn ot working as expected or not. So i just want your help to solve the issues
Code Snippet
main.ts
customeExceptionFilter.ts
Minimum reproduction code
https://stackblitz.com/edit/nestjs-typescript-starter-fh82bz?file=src%2Fcustome-exception.filter.ts
Steps to reproduce
Install required packages Run the api server with fastfyAdapter and CustomEExceptionFilter Using postman make the server through and error. You will get error like
Expected behavior
The response object i will get in the customExceptionFilter must be the type of fastifyReply and i can use the methods respectively
Package
Other package
No response
NestJS version
10.02
Packages versions
Node.js version
20.15.1
In which operating systems have you tested?
Other
No response