Closed fommil closed 6 years ago
misunderstanding, if the error makes it to unsafePerformIO
, this will be printed.
to match cats behaviour
implicit class TaskOps[A](val io: Task[A]) extends AnyVal {
def unsafeRunSync(): A = ZIO.unsafePerformIO(io.attempt[Void]) match {
case -\/(underlying) => throw underlying
case \/-(a) => a
}
}
I went with:
trait MuteRTS extends RTS {
override def defaultHandler[E]: Throwable => IO[E, Unit] = _ => IO.unit
}
I'm using
IO.syncThrowable
to invoke a legacy method that can throw an exception.But even though that's supposed to capture the execption as a valid
Task
error, not an unexpected exception, I'm still getting the stacktrace dumped to the screen withI can try to minimise it with an example if this is difficult to see by inspection.