Skip to content
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 method to RetryException to get a typed last Attempt #225

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

sleberknight
Copy link
Member

  • Add getLastFailedAttempt(Class type) to RetryException
  • Add reference to this method in API Note in getLastFailedAttempt()

Closes #224

* Add getLastFailedAttempt(Class<T> type) to RetryException
* Add reference to this method in API Note in getLastFailedAttempt()

Closes #224
@sleberknight sleberknight self-assigned this Jun 6, 2024
Instead of just casting, check that the Attempt either:

1. does not contain a result (it contains an Exception)
2. contains a result that can be assigned to the specified type

If either the above conditions is true, then a cast is safe.

Change function to throw IlegalStateException with a
descriptive message instead of just letting th JVM throw
a ClassCastException with no message.
Copy link

sonarqubecloud bot commented Jun 6, 2024

@sleberknight sleberknight merged commit 7f89ffe into main Jun 6, 2024
5 checks passed
@sleberknight sleberknight deleted the 224-add-method-to-get-typed-Attempt branch June 6, 2024 14:56
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.

Add method to RetryException to get a typed last Attempt
1 participant