As of spring-projects/spring-framework#23741, Spring Framework allows ResponseStatusException instances to contribute HTTP headers to the error response.

The current infrastructure with AbstractErrorWebExceptionHandler and DefaultErrorWebExceptionHandler allow for user extension but is causing some challenges: * it duplicates efforts with what's being done in Spring Framework, as it needs to handle error responses completely * it doesn't allow to easily let exceptions contribute to the actual response.

This issue is about catching up with spring-projects/spring-framework#23741, and also checking whether there is a way to improve the situation.