diff --git a/core/src/main/scala/fs2/io/ssh/Client.scala b/core/src/main/scala/fs2/io/ssh/Client.scala index 4965137..5dbfa29 100644 --- a/core/src/main/scala/fs2/io/ssh/Client.scala +++ b/core/src/main/scala/fs2/io/ssh/Client.scala @@ -141,8 +141,8 @@ final class Client[F[_]] private (client: SshClient)(implicit F: Async[F]) { _ <- Resource eval { success match { - case Left(_: SshException) => - FR.raise(Error.Authentication) + case Left(ex: SshException) => + FR.raise(Error.SshErr(ex)) case Left(e) => F.raiseError(e) @@ -189,6 +189,6 @@ object Client { sealed trait Error extends Product with Serializable object Error { - case object Authentication extends Error + case class SshErr(ex: SshException) extends Error } } diff --git a/core/src/test/scala/fs2/io/ssh/ClientSpec.scala b/core/src/test/scala/fs2/io/ssh/ClientSpec.scala index 4be62c8..15a4c58 100644 --- a/core/src/test/scala/fs2/io/ssh/ClientSpec.scala +++ b/core/src/test/scala/fs2/io/ssh/ClientSpec.scala @@ -101,7 +101,14 @@ class ClientSpec extends CatsEffectSuite with SshDockerService { .void } { eit => EitherT.liftF( - eit.value.map(a => assertEquals(a, Left(Client.Error.Authentication))) + eit.value.map(a => + assert( + a.swap + .map({ case Client.Error.SshErr(_) => true }) + .getOrElse(false), + s"Got $a" + ) + ) ) } diff --git a/version.sbt b/version.sbt index b214d43..43bda68 100644 --- a/version.sbt +++ b/version.sbt @@ -1,2 +1,2 @@ -// Last bumped by PR 108 -ThisBuild / version := "3.1.0" +// Last bumped by PR 110 +ThisBuild / version := "4.0.0"