diff --git a/zio-http/shared/src/main/scala/zio/http/ZClient.scala b/zio-http/shared/src/main/scala/zio/http/ZClient.scala index 1b8aa6431b..014d77cca6 100644 --- a/zio-http/shared/src/main/scala/zio/http/ZClient.scala +++ b/zio-http/shared/src/main/scala/zio/http/ZClient.scala @@ -670,7 +670,7 @@ object ZClient extends ZClientPlatformSpecific { webSocketUrl <- url.scheme match { case Some(Scheme.HTTP) | Some(Scheme.WS) | None => ZIO.succeed(url.scheme(Scheme.WS)) case Some(Scheme.WSS) | Some(Scheme.HTTPS) => ZIO.succeed(url.scheme(Scheme.WSS)) - case _ => ZIO.fail(throw new IllegalArgumentException("URL's scheme MUST be WS(S) or HTTP(S)")) + case _ => ZIO.fail(new IllegalArgumentException("URL's scheme MUST be WS(S) or HTTP(S)")) } scope <- ZIO.scope res <- requestAsync( diff --git a/zio-http/shared/src/main/scala/zio/http/codec/HttpContentCodec.scala b/zio-http/shared/src/main/scala/zio/http/codec/HttpContentCodec.scala index 3f8a3f29a2..916742b9e9 100644 --- a/zio-http/shared/src/main/scala/zio/http/codec/HttpContentCodec.scala +++ b/zio-http/shared/src/main/scala/zio/http/codec/HttpContentCodec.scala @@ -35,7 +35,7 @@ sealed trait HttpContentCodec[A] { self => ZIO.fromEither(codec.codec(config).decode(bytes)) } case None => - ZIO.fail(throw new IllegalArgumentException(s"No codec found for content type $contentType")) + ZIO.fail(new IllegalArgumentException(s"No codec found for content type $contentType")) } } @@ -50,7 +50,7 @@ sealed trait HttpContentCodec[A] { self => ZIO.fromEither(codec.codec(config).decode(bytes)) } case None => - ZIO.fail(throw new IllegalArgumentException(s"No codec found for content type $contentType")) + ZIO.fail(new IllegalArgumentException(s"No codec found for content type $contentType")) } }