Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebMvcConfigurationSupport should not catch Throwable for SourceHttpMessageConverter #29537

Closed
sbrannen opened this issue Nov 21, 2022 · 1 comment
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@sbrannen
Copy link
Member

The WebMvcConfigurationSupport.addDefaultHttpMessageConverters() method catches Throwable for SourceHttpMessageConverter instantiation; whereas, the rest of the code base correctly catches Error for SourceHttpMessageConverter instantiation (to handle errors such as NoClassDefFoundError).

Throwable should not be caught since it can mask other categories of failures (such as configuration errors).

@sbrannen sbrannen added in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug labels Nov 21, 2022
@sbrannen sbrannen added this to the 5.3.25 milestone Nov 21, 2022
@sbrannen sbrannen self-assigned this Nov 21, 2022
sbrannen added a commit that referenced this issue Nov 21, 2022
Prior to this commit, the addDefaultHttpMessageConverters() method in
WebMvcConfigurationSupport caught Throwable for SourceHttpMessageConverter
instantiation; whereas, the rest of the code base correctly catches Error
for SourceHttpMessageConverter instantiation (to handle errors such as
NoClassDefFoundError).

Throwable should not be caught since it can mask other categories of
failures (such as configuration errors).

This commit therefore switches to catching Error for SourceHttpMessageConverter
instantiation in WebMvcConfigurationSupport.

Closes gh-29537
@sbrannen
Copy link
Member Author

Fixed in 72b44ce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant