Skip to content

refactor: update CheckedConsumer interface and Result methods to improve exception handling#6

Merged
jmochel merged 1 commit intomasterfrom
refactor/remove-exceptions-from-if-methods
Oct 31, 2025
Merged

refactor: update CheckedConsumer interface and Result methods to improve exception handling#6
jmochel merged 1 commit intomasterfrom
refactor/remove-exceptions-from-if-methods

Conversation

@jmochel
Copy link
Copy Markdown
Owner

@jmochel jmochel commented Oct 31, 2025

  • Changed the accept method in CheckedConsumer to return a value of type T instead of void, enhancing its usability.
  • Removed the throws Exception declaration from ifSuccess and ifFailure methods in Result and their implementations in Failure and Success, simplifying the method signatures.
  • Updated the ifFailure method to properly handle exceptions thrown by the action, returning a new Failure instance with the exception details.
  • Adjusted tests to validate the new behavior and ensure consistent results across success and failure scenarios.

…ove exception handling

- Changed the accept method in CheckedConsumer to return a value of type T instead of void, enhancing its usability.
- Removed the throws Exception declaration from ifSuccess and ifFailure methods in Result and their implementations in Failure and Success, simplifying the method signatures.
- Updated the ifFailure method to properly handle exceptions thrown by the action, returning a new Failure instance with the exception details.
- Adjusted tests to validate the new behavior and ensure consistent results across success and failure scenarios.
@jmochel jmochel merged commit ea7bdde into master Oct 31, 2025
1 check passed
@jmochel jmochel deleted the refactor/remove-exceptions-from-if-methods branch March 6, 2026 21:12
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.

1 participant