Hello people, what is the recommended way of handl...
# ktor
f
Hello people, what is the recommended way of handling different errors in a route in ktor? I find myself doing alot of this stuff
Copy code
if (constraint == null) {
    call.respond(HttpStatusCode.BadRequest, "Payload is so bad dude")
    return@get
}
And that does not seem ideal, and it gets even worse when I want to extract stuff into functions, I am currently just returning null and checking again in the main flow, seems stupid. How do one go about this? I have not quite understood how the whole routing thing works, is one GIANT function or something right?