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

NPE when dealing with a throwable with null message (failed IO) #24

Open
cpellizzari-ledger opened this issue Jan 11, 2022 · 0 comments

Comments

@cpellizzari-ledger
Copy link

Hi, thanks for the great work on this lib & others !

Steps to reproduce : fail a traced http route, for instance with IO.raiseError(new RuntimeException)

Expected : no "error.message" mapping, or default to empty string
Actual : NullPointerException is raised by Natchez Middleware, as the Circe Encoder fails to encode null value as a string (used with LogTracer).

https://github.com/tpolecat/natchez-http4s/blob/main/modules/http4s/src/main/scala/natchez/http4s/NatchezMiddleware.scala#L62
-> I guess we cannot expect every java + scala codebase with dependencies to always have a message value, and I believe this line should be null checked.

Also in core natchez, a fail-fast null check on put method could be helpful.

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

1 participant