You can install a feature like StatusPages and do ...
# ktor
v
You can install a feature like StatusPages and do something like
Copy code
install(StatusPages) {
        exception<Throwable> { cause ->
            log.error(cause)
            val error = HttpBinError(HttpStatusCode.InternalServerError, call.request.local.uri, cause.toString(), cause.cause?.message)
            call.respond(HttpStatusCode.InternalServerError, error)
        }
}
More info on here https://ktor.io/servers/features/status-pages.html
l
I thought that is for web page because of the name.. Thanks