Skip to content

MVC should respect @ResponseStatus on exceptions during mapping [SPR-12903] #17502

@spring-projects-issues

Description

@spring-projects-issues

Christopher Smith opened SPR-12903 and commented

I am using a Converter<String,DomainObject> to directly inject @PathVariable parameters as rich domain objects. If the domain object is not found, I would like to throw a NotFoundException, which is annotated with @ResponseStatus(NOT_FOUND), but MVC treats all mapping exceptions as 400 errors regardless of any status annotation. If a converter or other mapping component throws an annotated exception, the status should be returned to the client.


Affects: 4.1.4

Referenced from: commits 26cfe57

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions