Can I somehow Intercept at the end of a call ?
# ktor
a
Can I somehow Intercept at the end of a call ?
o
@avolkmann end of the call is somewhat undefined, depends on if you have WS, various features, interceptors, etc. What exactly do you need to do?
a
I need to log certain actions and would like to do so no matter if the call fails. Currently I would have to wrap every single route with a try catch.
o
Check out how
CallLogging
is implemented. You basically intercept at the beginning of pipeline, and call
proceed()
inside your interceptor. It returns when the rest of the pipeline is finished.
But if you need just exceptions, see
StatusPages
a
Ah I see that might help!
Thank you