Skip to content

Commit

Permalink
Do not log CancellationException in Logger.catch()
Browse files Browse the repository at this point in the history
  • Loading branch information
nerzhulart committed Aug 7, 2024
1 parent 396da37 commit 2768d91
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ object RdDefaultErrorLoggerHolder {
inline fun Logger.catch(comment: String?, action:() -> Unit) {
try {
action()
} catch (e : Throwable) {
}
catch (ce: CancellationException) {
throw ce
}
catch (e : Throwable) {
val sfx = "${e.javaClass.name} ${e.message}" + if (comment.isNullOrBlank()) "" else " ($comment)"
error("Catch $sfx", e)
}
Expand Down

0 comments on commit 2768d91

Please sign in to comment.