-
Notifications
You must be signed in to change notification settings - Fork 710
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 WrapExecutor #477
base: main
Are you sure you want to change the base?
Add WrapExecutor #477
Conversation
56b23f0
to
593c7f2
Compare
1f42ed1
to
2372bf0
Compare
@lavoiesl Thanks for your suggestion. With this improvement, I think we can restructure within Resty. I will consider this for Resty v3 |
- Expose an `Unwrap` method to leverage go's standard unwrapping - Let the error escape, such that hooks and end-users can access the `Temporary` information. - Do not wrap if the error already exposes `Temporary`, to honour it.
@jeevatkm Is there still a plan to release a v3? We ended up having to maintain a fork of resty because this hook proved essential to throttling, error handling, and metrics gathering. |
@lavoiesl I will aim this concept for v3. I know, I got delayed so much, I will make up for it. Thanks for your patience. |
Add the ability to wrap the request executor, granting full access to the request, response, and error.
Runs on every request attempt, before any request hook and after any response or error hook.
Can be useful to introduce throttling or add hooks that always fire, regardless of success or error.
Having access to the request even in case of errors means also having access to the request's context, which can be immensely helpful for proper error logging/reporting.
This PR is dependant on #478, to avoid re-wrapping
noRetryError