Wrapped error handle in UIO

This commit is contained in:
Rohan Sircar 2020-12-17 12:19:24 +05:30
parent 1f06c536c8
commit f95ecc2cb3

View File

@ -33,7 +33,7 @@ object Main extends MainModule with BIOApp {
override def run(args: List[String]): UIO[ExitCode] = override def run(args: List[String]): UIO[ExitCode] =
appResource(System.currentTimeMillis()) appResource(System.currentTimeMillis())
.use(_ => Task.unit) .use(_ => Task.unit)
.onErrorHandle(_.printStackTrace()) .onErrorHandleWith(ex => UIO(ex.printStackTrace()))
.as(ExitCode.Success) .as(ExitCode.Success)
} }