Skip to content

Commit

Permalink
make bean close safer
Browse files Browse the repository at this point in the history
  • Loading branch information
Walid Lezzar committed Jul 2, 2020
1 parent d831b6b commit bd76568
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion zoe-cli/src/utils/koin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ inline fun <reified T : Closeable?> Module.singleCloseable(
noinline definition: Definition<T>
) = single(qualifier, createdAtStart, override, definition) onClose {
logger.debug("closing: $it")
it?.close()
try {
it?.close()
} catch (err: Throwable) {
logger.error("error closing '$it': $err")
}
}

0 comments on commit bd76568

Please sign in to comment.