[main] report any errors

This commit is contained in:
Paul Campbell 2019-04-29 20:37:55 +01:00
parent 98c6c6b7df
commit c8c652fe2d

View file

@ -1,6 +1,6 @@
package net.kemitix.s3thorp
import cats.effect.ExitCase.Canceled
import cats.effect.ExitCase.{Canceled, Completed, Error}
import cats.effect.{ExitCode, IO, IOApp}
import cats.syntax.all._
@ -14,7 +14,8 @@ object Main extends IOApp {
override def run(args: List[String]): IO[ExitCode] =
exec(args).guaranteeCase {
case Canceled => IO(println("Interrupted"))
case _ => IO(println("Done"))
case Error(e) => IO(println("ERROR: " + e))
case Completed => IO(println("Done"))
}
}