mkporwit
10/04/2017, 9:01 PMexception<NoSuchElementException> {
cause ->
log.error(cause.localizedMessage)
val sw = StringWriter()
cause.printStackTrace(PrintWriter(sw))
val exceptionAsString = sw.toString()
log.error(exceptionAsString)
call.response.status(HttpStatusCode.NotFound)
call.respondText(cause.message.toString())
}
exception<InvalidJwtException> {
cause ->
log.error(cause.localizedMessage)
val sw = StringWriter()
cause.printStackTrace(PrintWriter(sw))
val exceptionAsString = sw.toString()
log.error(exceptionAsString)
call.response.status(HttpStatusCode.Unauthorized)
call.respond(cause.message.toString())
}