https://kotlinlang.org logo
#ktor
Title
# ktor
h

Hexa

10/19/2021, 8:32 PM
is the
return@get
required here or can it can remove?
Copy code
route("/test") {
            get {
                try {
                     // some logic
                    call.respond(HttpStatusCode.OK)
                }  catch (e: Exception) {
                     return@get call.respond(HttpStatusCode.InternalServerError) // here
                }
            }
r

Rustam Siniukov

10/19/2021, 9:31 PM
You can remove it. Also, consider using
StatusPages
plugin to handle exceptions.
3 Views