Extend a problem by stacktrace, too.
Opened this issue · 5 comments
Zalando problem supports stacktraces as part of an API "problem" response, see https://github.com/zalando/problem#stack-traces-and-causal-chains
{
"type": "about:blank",
"title": "Unprocessable Entity",
"status": 400,
"stacktrace": [
"org.example.Example.execute(Example.java:17)",
"org.example.Example.main(Example.java:11)"
]
}
Feature request
This extension provides stacktraces, too
Additional context
- Maybe a good starting point is, to show the stacktrace in Quarkus dev or test launch mode (see https://quarkus.io/guides/lifecycle#launch-modes)
- But "showing stacktraces" should be configurable probably
- Keep "native image" in mind
- Related #35
- Some work has been done already, see https://github.com/SchulteMarkus/quarkus-problem-extension/commit/251a8cb67b84825e5504de978cd67aef97a11bf4
Thx. This should definitely be made configurable. Personally, I don't want to present internal exceptions to the user. But there may be other use cases. Or like you have implemented as a "devmode" feature.
@CrystalMethod You mentioned https://github.com/SchulteMarkus/quarkus-problem-extension/commit/251a8cb67b84825e5504de978cd67aef97a11bf4 cannot be used for time being, as because of native image there has additional work to be done. I think 251a8c would be a good start. What additional work has to be done?
I had a closer look at your solution for stacktraces. Without having actually tried it in native mode, I can imagine that this solution also works in native mode. I was referring to the use of the solution described here to publish stacktraces. Zalando is using SPI/Service Loader and this wan't work in native mode out of the box.
Ah I see.
So maybe integrate https://github.com/SchulteMarkus/quarkus-problem-extension/commit/251a8cb67b84825e5504de978cd67aef97a11bf4 into this extension? And maybe a follow up issue for making this behavior configurable.