Skip to content

fix: release update notification error handling #292#304

Open
codecharlan wants to merge 1 commit intotoloka-agent/139-autofrom
bugfix/292-release-update-notification-error-handling
Open

fix: release update notification error handling #292#304
codecharlan wants to merge 1 commit intotoloka-agent/139-autofrom
bugfix/292-release-update-notification-error-handling

Conversation

@codecharlan
Copy link
Copy Markdown

@codecharlan codecharlan commented Mar 27, 2026

Bug fix for #292

FAIL_TO_PASS: ReleaseServiceTest

@codecharlan codecharlan force-pushed the bugfix/292-release-update-notification-error-handling branch from 90fb659 to 2775489 Compare March 31, 2026 14:10
@codecharlan codecharlan force-pushed the bugfix/292-release-update-notification-error-handling branch from 2775489 to 98c51f8 Compare April 1, 2026 08:20
new UpdateReleaseCommand("IDEA-1.0", "desc", ReleaseStatus.RELEASED, null, "manager");

// When / Then - the exception must propagate so @Transactional can roll back
assertThatThrownBy(() -> releaseService.updateRelease(cmd)).isInstanceOf(RuntimeException.class);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checking specifically for RuntimeException is too implementation-specific here. The important part is that the error is not swallowed and the update fails. Another valid fix could propagate a different exception type and still be correct, so it would be better to assert only that the call throws.
for example assertThatThrownBy(() -> releaseService.updateRelease(cmd));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants