Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base exception filter ignores exception cause #13550

Open
2 of 15 tasks
jeengbe opened this issue May 8, 2024 · 2 comments
Open
2 of 15 tasks

Base exception filter ignores exception cause #13550

jeengbe opened this issue May 8, 2024 · 2 comments

Comments

@jeengbe
Copy link

jeengbe commented May 8, 2024

Is there an existing issue for this?

  • 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
  • @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

@jeengbe jeengbe added the needs triage This issue has not been looked into label May 8, 2024
@kamilmysliwiec
Copy link
Member

Would you like to create a PR for this issue?

@jeengbe
Copy link
Author

jeengbe commented May 21, 2024

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.

@micalevisk micalevisk removed the needs triage This issue has not been looked into label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants