Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
handle connection.isValid thrown exceptions (#149)
Browse files Browse the repository at this point in the history
* handle connection.isValid thrown exceptions

* log cause of failed validity check

* Revert "log cause of failed validity check"

This reverts commit 333d32b.
  • Loading branch information
oridag authored Nov 6, 2023
1 parent 8adc5a0 commit e2c925c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/zio/jdbc/ZConnectionPool.scala
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ object ZConnectionPool {
connection <- pool.get
_ <- ZIO.addFinalizerExit { exit =>
ZIO
.ifZIO(connection.isValid().orDie)(
.ifZIO(connection.isValid().orElse(ZIO.succeed(false)))(
onTrue = exit match {
case Exit.Success(_) => connection.restore
case Exit.Failure(_) =>
Expand Down

0 comments on commit e2c925c

Please sign in to comment.