-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Call After block on error! #1147
Comments
You can write a separate middleware to handle this. I am not theoretically against to executing |
@ccastan1 It would be good to have a minimal example here or a spec that demonstrates this. |
@ccastan1 @dblock, this is how I'm trying to wrap API calls with a middleware:
Then in my API:
My middleware after block is never called when the API endpoint raises an error... |
Looks like the following middleware would do it:
|
Makes sense @frobichaud. If you have time, see if any tests break if |
👍 It could be a great functionality ! |
Great thanks for sharing this. I was trying to log on Success and Error so below implementation works for me.
|
Not sure if this was resolved, but I've been trying to log api calls from the middleware and on an error! the after call doesn't get executed. Is there a good way around this issue? Thanks!
The text was updated successfully, but these errors were encountered: