nest
nest copied to clipboard
Base exception filter ignores exception cause
Is there an existing issue for this?
- [X] I have searched the existing issues
Current behavior
The base exception filter (https://github.com/nestjs/nest/blob/master/packages/core/exceptions/base-exception-filter.ts#L72-L75) simply drops any properties on errors other than message and stack, especially cause
. This is very unfortunate as cause is when provided often crucial to understanding an error.
Minimum reproduction code
n/a
Steps to reproduce
No response
Expected behavior
Additional properties, especially cause
should not simply be ignored, but forwarded to the logger.
Package
- [ ] I don't know. Or some 3rd-party package
- [ ]
@nestjs/common
- [X]
@nestjs/core
- [ ]
@nestjs/microservices
- [ ]
@nestjs/platform-express
- [ ]
@nestjs/platform-fastify
- [ ]
@nestjs/platform-socket.io
- [ ]
@nestjs/platform-ws
- [ ]
@nestjs/testing
- [ ]
@nestjs/websockets
- [ ] Other (see below)
Other package
No response
NestJS version
No response
Packages versions
n/a
Node.js version
No response
In which operating systems have you tested?
- [ ] macOS
- [ ] Windows
- [ ] Linux
Other
No response
Would you like to create a PR for this issue?
I have little understanding of what's happening with the error and why message and stack are logged explicitly. I guess the change would require more refactoring than just my simple patch, sorry.
Hi @micalevisk, @kamilmysliwiec
I'm interested in working on this issue and improving the base-exception-filter
I've created a PR #13681
Could you take a look? :)
Let's track this here https://github.com/nestjs/nest/pull/13870