Skip to content

Handle any exception that is not handled by the client application#30

Merged
natrajmolala merged 2 commits intomainfrom
dev/handle-error-executing-tasks
Mar 2, 2026
Merged

Handle any exception that is not handled by the client application#30
natrajmolala merged 2 commits intomainfrom
dev/handle-error-executing-tasks

Conversation

@natrajmolala
Copy link
Contributor

Before creating a pull request make sure that:

  • commit messages are meaningful and follow good commit message guidelines
  • README and other documentation has been updated / added (if needed)
  • tests have been updated / new tests has been added (if needed)

Please remove this line and everything above and fill the following sections:

JIRA link (if applicable)

Change description

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[ ] No


logger.info("TestErrorTask executing for job: {}", jobData);

if (jobData.containsKey(ERROR_KEY)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

you can simplify this and just throw an exception without the if and also not return..

just these three lines will do

final UUID id = jobData.containsKey(ID_KEY) ? fromString(jobData.getString(ID_KEY)) : randomUUID();
            taskStatusService.recordRetryAttempt(id, jobData);

            throw new IllegalStateException("Task with retry attempts failed to complete due to unexpected errors!");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done


logger.info("TestErrorTask executing for job: {}", jobData);

if (jobData.containsKey(ERROR_KEY)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@natrajmolala natrajmolala merged commit 736c83a into main Mar 2, 2026
30 of 40 checks passed
@natrajmolala natrajmolala deleted the dev/handle-error-executing-tasks branch March 2, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants