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

Document clearly the recover method matching algorithm #115

Open
davidmichaelkarr opened this issue Jun 9, 2018 · 0 comments
Open

Document clearly the recover method matching algorithm #115

davidmichaelkarr opened this issue Jun 9, 2018 · 0 comments

Comments

@davidmichaelkarr
Copy link

Reading the documentation, it seems to me it would be helpful if the matching algorithm for determining a corresponding Recover method was explicitly spelled out. From what I can tell, it ONLY looks at the exception type. It's easy for someone to assume that since the recover method should (can?) have parameters matching the retryable method, that those would be used as part of the matching algorithm.

For instance, if a class has multiple retryable methods, more than one of which can fail with the same exception type, but with a different set of parameters, someone might write multiple recover methods that take the same exception type, but with different additional parameters.

This might even work in some situations, depending accidentally on how the algorithm picks the first method with the matching exception type. In other situations, someone would run into a weird exception deep in the retry mechanism, trying to copy a set of actual parameters to a set of variables whose type (or number) doesn't match.

However, now that I've pointed out the mistake that someone could make, I think it might also be useful to consider extending the matching algorithm to include the number and type of parameters. I know the parameters are optional, but I would think most people would be taking advantage of that.

At a minimum, the existing matching algorithm should be clearly documented.

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

No branches or pull requests

1 participant