Skip to content

Commit

Permalink
Fix "ZIO.fail(throw" (#3220)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejressel authored Nov 25, 2024
1 parent dc1f3f4 commit 6137aa0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion zio-http/shared/src/main/scala/zio/http/ZClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
}

Expand All @@ -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"))
}
}

Expand Down

0 comments on commit 6137aa0

Please sign in to comment.