Skip to content

Commit

Permalink
Handle exception when checking for closed connection (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyprime committed Feb 9, 2022
1 parent 98b5621 commit 71b1e9c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,11 @@ class VerticaJdbcLayer(cfg: JDBCConfig) extends JdbcLayerInterface {

def isClosed(): Boolean = {
logger.debug("Checking if connection is closed.")
this.connection.fold(_ => true, conn => conn.isClosed())
try {
this.connection.fold(_ => true, conn => conn.isClosed())
} catch {
case _ : Throwable => true
}
}

def configureSession(fileStoreLayer: FileStoreLayerInterface): ConnectorResult[Unit] = {
Expand Down

0 comments on commit 71b1e9c

Please sign in to comment.