I've just made a custom feature to capture some me...
# ktor
a
I've just made a custom feature to capture some metrics which uses:
Copy code
pipeline.environment.monitor.subscribe(Routing.RoutingCallFinished)
I noticed some interesting behavior, when I rejected calls by throwing exceptions I didn't get the response status-code anymore in the above
RoutingCallFinished
(I'm handling exceptions via
install(StatusPages)
). On debugging I see that the statusPages code is called after all Routing has finished. After this I moved the
install(StatusPages)
block inside
install(Routing) {}
which solved the problem. Now The exception is handled by StatusPages before
RoutingCallFinished
is called. So just wanted to know, is this expected behavior? Is my solution valid?