<@U27AJB80L> I think I would write the code someth...
# announcements
r
@noctarius I think I would write the code something like this:
Copy code
fun <T> response(req: HttpServerRequest): Handler<AsyncResult<T>> = Handler { result ->
    with(req.response()) {
        val (code, body) = if (result.succeeded()) 200 to result.result() else 500 to result.cause()
        statusCode = code
        write(body.toString())
        end()
    }
}