Skip to content

Automatically configure ProblemModule based on include-stacktrace Property #708

@schmitzhermes

Description

@schmitzhermes

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions