spring-projects / spring-projects/spring-framework

Revisit MVC ResponseEntityExceptionHandler

Open
#34,272 4 comments 7 reactions 1 assignee View on GitHub

@bclozel is already working on this.

Since Jun 26, 2025.

in: web type: enhancement
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

The ResponseEntityExceptionHandler handles exceptions at the MVC/WebFlux level as Problem Details. Right now, only machine-readable formats are managed.

The Spring Boot global error handling not only handles JSON, but also static pages and view templates. This infrastructure is currently based on an ErrorController and an ErrorAttributes object. Errors are handled during error dispatches.

Errors should be as much as possible handled by the application, error dispatches should be the last resort. Spring Framework should help applications by providing a flexible mechanism for rendering errors as HTML. For that, we can probably lean on content negotiation support and the ordering of handlers.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.