From 316661e122fbf668a88c454cd6527a0a7d6c07e3 Mon Sep 17 00:00:00 2001 From: rintcius Date: Mon, 24 Nov 2025 12:42:30 +0100 Subject: [PATCH 1/2] Keep exception in case of error ... also rename because we can't assume these are always auth errors --- core/src/main/scala/fs2/io/ssh/Client.scala | 6 +++--- core/src/test/scala/fs2/io/ssh/ClientSpec.scala | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) 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" + ) + ) ) } From 6959e7f52e95f4cdce729ce6dcf65c877600c3c7 Mon Sep 17 00:00:00 2001 From: rintcius <888781+rintcius@users.noreply.github.com> Date: Mon, 24 Nov 2025 11:44:13 +0000 Subject: [PATCH 2/2] Version bump: 4.0.0 --- version.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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"