Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/src/main/scala/fs2/io/ssh/Client.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
}
9 changes: 8 additions & 1 deletion core/src/test/scala/fs2/io/ssh/ClientSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)
)
}

Expand Down
4 changes: 2 additions & 2 deletions version.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Last bumped by PR 108
ThisBuild / version := "3.1.0"
// Last bumped by PR 110
ThisBuild / version := "4.0.0"