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

Add CacheErrorHandler implementation that logs exceptions rather than rethrowing them #27788

Closed
bananayong opened this issue Dec 9, 2021 · 3 comments
Labels
status: superseded An issue that has been superseded by another

Comments

@bananayong
Copy link
Contributor

Hello.

I would like to suggest that the Spring framework provide another CacheErrorHandler Implementation.
Whenever I build a spring application that uses an external cache, I do write a class that implements CacheErrorHandler for just error logging rather than throwing an exception.

Maybe most developers don't want to fail a method invocation when the cache is not available because the original method can return results.

So, If Spring provides another CacheErrorHandler implementation for just logging, will be very convinient.

Thank you!


@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 9, 2021
@snicoll snicoll changed the title Add another CacheErrorHandler implementation Add CacheErrorHAndler implementation that logs exceptions rather than rethrowing them Dec 9, 2021
@snicoll snicoll changed the title Add CacheErrorHAndler implementation that logs exceptions rather than rethrowing them Add CacheErrorHandler implementation that logs exceptions rather than rethrowing them Dec 9, 2021
@snicoll snicoll added this to the Triage Queue milestone Dec 9, 2021
@Drezir
Copy link
Contributor

Drezir commented Dec 15, 2021

I think that this is why we have org.springframework.cache.annotation.CachingConfigurer mechanism. But the implementation could be done, but the question is which logging level to use? Should it be configurable or not?

@bananayong
Copy link
Contributor Author

If logging level is configurable It could be very useful, but I think It's ok just WARN.

@snicoll
Copy link
Member

snicoll commented Jan 12, 2022

Closing in favor of PR #27826 - Thanks @Drezir!

@snicoll snicoll closed this as completed Jan 12, 2022
@snicoll snicoll added the status: superseded An issue that has been superseded by another label Jan 12, 2022
@snicoll snicoll removed this from the Triage Queue milestone Jan 12, 2022
@rstoyanchev rstoyanchev removed the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

5 participants