typelevel/cats-effect

`unsafeRunAndForget()` doesn't log errors

Closed this issue · 0 comments

* Note that errors still get logged (via IO's internal logger), because errors being thrown
* should never be totally silent.
*/
def unsafeRunAndForget()(implicit runtime: unsafe.IORuntime): Unit = {

//> using lib "org.typelevel::cats-effect::3.5.0-RC3"

import cats.effect.*
import cats.effect.unsafe.implicits.*

@main def main =
  IO.raiseError(new RuntimeException).unsafeRunAndForget()
  Thread.sleep(1000)
[Hello darkness, my old friend]