problem-spring-web
problem-spring-web copied to clipboard
Automatically configure ProblemModule based on include-stacktrace Property
Hi all.
I was wondering why the existing Spring property server.error.include-stacktrace
is not picked up by default from the framework, especially looking at the problem-spring-web-autoconfigure
module.
Detailed Description
Currently, my setup looks something like this:
@Bean
fun problemModule(@Value("\${server.error.include-stacktrace:NEVER}") includeStacktrace: ErrorProperties.IncludeStacktrace): Module {
return ProblemModule().withStackTraces(includeStacktrace == ErrorProperties.IncludeStacktrace.ALWAYS)
}
I could imagine building this into this class directly.
Context
I would like to reduce the amount of custom code for error handling to the minimum and I could imagine others thinking the same.
Possible Implementation
see above
Your Environment
- Version used: 0.28.0-RC0
- Link to your project: private