package Ġdev . sv ilen iv an ov . raft kt . core Ċ Ċ import Ġkotlinx . coroutines . Coroutine ExceptionHandler Ċ import Ġorg . slf 4 j . Logger Ċ import Ġorg . slf 4 j . Marker Ċ import Ġkotlin . random . Random Ċ import Ġkotlin . time . Duration Ċ Ċ fun ĠLogger . as ExceptionHandler ( marker : ĠMarker ) Ġ= ĠCor outine ExceptionHandler Ġ{ Ġ_, Ġe Ġ-> ĊĠĠĠ Ġerror ( marker , Ġ" Un caught Ġexception Ġin Ġcoroutine ", Ġe ) Ċ } Ċ Ċ internal Ġfun Ġcalc Random Timeout ( timeout : ĠDuration ): ĠDuration Ġ{ ĊĠĠĠ Ġreturn ĠDuration . milliseconds ( timeout . in Whole Milliseconds Ġ+ ĠRandom . next Long ( timeout . in Whole Milliseconds )) Ċ } Ċ