Skip to content

CacheAspectSupport initialization failure should throw dedicated exceptions, rather than IllegalStateException #22442

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

Closed
snicoll opened this issue Feb 20, 2019 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Feb 20, 2019

CacheAspectSupport has two throw clause with IllegalStateException that represents a user-facing configuration problem. It would be nice to adapt them so that we provide additional context and information.

I wonder if re-throwing NoUniqueBeanDefinitionException and NoSuchBeanDefinitionException with extra semantic would be an option.

The plan is to add a FailureAnalyzer without having to write too much code since these low-level exceptions are already handled.

See spring-projects/spring-boot#13348 for more context.

@rstoyanchev rstoyanchev added the in: core Issues in core modules (aop, beans, core, context, expression) label Nov 10, 2021
@jhoeller jhoeller added the type: enhancement A general enhancement label Jan 17, 2024
@jhoeller jhoeller added this to the 6.x Backlog milestone Jan 17, 2024
@jhoeller jhoeller modified the milestones: 6.x Backlog, 6.2.x Mar 2, 2024
@snicoll snicoll self-assigned this Apr 29, 2024
@snicoll snicoll changed the title Use dedicated exception type in cache bootstrap failure Stop wrapping low-level exceptions in CacheAspectSupport initialization Apr 29, 2024
@snicoll snicoll modified the milestones: 6.2.x, 6.2.0-M2 Apr 29, 2024
@snicoll snicoll changed the title Stop wrapping low-level exceptions in CacheAspectSupport initialization CacheAspectSupport initialization failure should throw dedicated exceptions, rather than IllegalStateException Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants