-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
Milestone
Description
In all my code that calls the rpc services I end up wrapping the call in a try catch and doing the same error treatment. I was looking at if it was possible to add some kind of middleware/hooks/interceptor, but that would ideally need to be available in the generated code. Looking at the Go client I see that they now have client hooks (https://godoc.org/github.com/twitchtv/twirp#ClientHooks).
The implementation would probably look a lot like the server hooks, an argument to the client creation with a class that implements the RequestPrepared, ResponseReceived and Error functions.
What do you think ?