dave
03/28/2019, 5:21 AMthen()
. We provide the one below which should give you a general idea, but you can easily write your own to plug in whatever logger you need: object CatchAll {
operator fun invoke(errorStatus: Status = INTERNAL_SERVER_ERROR): Filter = Filter { next ->
{
try {
next(it)
} catch (e: Exception) {
val sw = StringWriter()
e.printStackTrace(PrintWriter(sw))
Response(errorStatus).body(sw.toString())
}
}
}
}
krtko
03/28/2019, 4:38 PMdave
03/28/2019, 4:39 PMkrtko
03/28/2019, 4:40 PM