-
Notifications
You must be signed in to change notification settings - Fork 63
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
Should it be possible to have multiple fallbacks #507
Comments
In the |
@Ladicek the FallbackHandler cannot access the same instance of the method residing. In order to provide the simpler model, we could do the following:
This is very simple. We just need to make |
Can it not inject it? Sure, then it wouldn't be able to access private methods...
This is not "very simple". What happens when the exception matches multiple fallback annotations? First matching wins? Last matching wins? Most specific wins? Frankly, I'd consider more interesting to somehow let the fallback method access the causing exception. I still consider this a niche case, though. In my opinion, fallback doesn't typically depend on the thrown exception, but on the method in question. |
We discussed this further at today's hangout with @Ladicek @Azquelt @Joseph-Cass , the concern with the matching orders from @Ladicek is difficult to handle. With this, since FallbackHandler is designed for advanced users and can handle this use case, we will not attempt to introduce another way to do the same thing. @NottyCode what do you think? |
I'd personally close this issue, because I really don't want to create another syntax for |
With the update to Fallbacks to support triggering on particular exceptions it makes me wonder if it would be useful to support multiple Fallbacks on a method so different exceptions can trigger different fallback behaviour.
Something like:
The text was updated successfully, but these errors were encountered: