-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Conversation
7e8b3d1
to
9390fe5
Compare
There was a problem hiding this 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.
...ng-context/src/main/java/org/springframework/cache/interceptor/LoggingCacheErrorHandler.java
Outdated
Show resolved
Hide resolved
* Construct new {@link LoggingCacheErrorHandler} that may log stacktraces. | ||
* @param includeStacktrace whether to log or not log stacktraces. | ||
*/ | ||
public LoggingCacheErrorHandler(boolean includeStacktrace) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
...ng-context/src/main/java/org/springframework/cache/interceptor/LoggingCacheErrorHandler.java
Outdated
Show resolved
Hide resolved
Sure, I will do it. |
@Drezir thanks for the follow-up. |
issue #27788
I have some more configurable version prepared but I think it is too much (see attachment)
configurable-version.zip
e