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 #27826

Closed
wants to merge 2 commits into from

Conversation

Drezir
Copy link
Contributor

@Drezir Drezir commented Dec 16, 2021

issue #27788

I have some more configurable version prepared but I think it is too much (see attachment)
configurable-version.zip
e

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 16, 2021
@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 12, 2022
@snicoll snicoll added this to the 5.3.16 milestone Jan 12, 2022
Copy link
Member

@snicoll snicoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. It would be nice to have some tests to exercise the new code. Would you have the time to look at it? If you don't, no worries and let us know so that we can take over.

* Construct new {@link LoggingCacheErrorHandler} that may log stacktraces.
* @param includeStacktrace whether to log or not log stacktraces.
*/
public LoggingCacheErrorHandler(boolean includeStacktrace) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a constructor that takes a Logger. This way you can easily provide a mock and test the behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added builder pattern and two test cases. Should tests cover each handler method or does this suffice?

@Drezir
Copy link
Contributor Author

Drezir commented Jan 12, 2022

Thanks for the PR. It would be nice to have some tests to exercise the new code. Would you have the time to look at it? If you don't, no worries and let us know so that we can take over.

Sure, I will do it.

@snicoll snicoll changed the title CacheErrorHandler implementation which simply logs exception. Add CacheErrorHandler implementation that logs exceptions rather than rethrowing them Jan 14, 2022
@snicoll snicoll self-assigned this Jan 26, 2022
@snicoll snicoll closed this in 4f16d5b Jan 26, 2022
@snicoll
Copy link
Member

snicoll commented Jan 26, 2022

@Drezir thanks for the follow-up.

@sbrannen sbrannen added the in: core Issues in core modules (aop, beans, core, context, expression) label Jan 26, 2022
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

Successfully merging this pull request may close these issues.

None yet

4 participants