Skip to content
This repository was archived by the owner on Dec 1, 2025. It is now read-only.

Conversation

@dmytro-bekuzarov
Copy link
Contributor

@dmytro-bekuzarov dmytro-bekuzarov commented Apr 17, 2025

Context

By default, we log processing exceptions with ERROR logging level.
If you do not want to log a specific error, or if you want to log it yourself (for example, you want to log with INFO level instead or on last retry only), you can now override the behaviour using ITaskRetryPolicy#logException method.

Checklist

@dmytro-bekuzarov dmytro-bekuzarov marked this pull request as ready for review April 17, 2025 09:56
@dmytro-bekuzarov dmytro-bekuzarov requested a review from a team as a code owner April 17, 2025 09:56
* @param task task
* @param t thrown exception
* @param retryTime next retry time, {@code null} if no next retry
* @return {@code true} if the exception should be logged, {@code false} otherwise
Copy link
Contributor

Choose a reason for hiding this comment

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

I find how this API combines "should log an exception" return type and "do the logging of an exception if you override it" rather confusing, since if an implementer decided to override this to log at INFO this line would no longer be accurate. IMO It would be better to separate the two.

@dmytro-bekuzarov dmytro-bekuzarov force-pushed the log-error-override branch 3 times, most recently from 4579595 to 1c5e7cf Compare April 25, 2025 10:52
@dmytro-bekuzarov dmytro-bekuzarov merged commit 32128d1 into master Apr 29, 2025
13 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants