Hi, I want to record every failed request made by ...
# ktor
d
Hi, I want to record every failed request made by the http client in the database. I'm using HttpRequestRetry plugin, but I can catch only the last exception throw(for example ConnectException: Connection refused) from the client.post execution. Is there a way to catch all failed responses ?
a
You can subscribe the client to the
HttpRequestRetryEvent
to be notified on each retry:
Copy code
client.monitor.subscribe(HttpRequestRetryEvent) {
    println(it.cause)
}
d
You're a lifesaver, thank you so much