mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
[starter] Simplify method
GitOrigin-RevId: d35ee862c518e9be12194cede107f6dc832e0f0b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d2fba3447f
commit
3b811a054d
@@ -16,17 +16,13 @@ object EventsBus {
|
||||
val SHARED_EVENTS_FLOW = SharedEventsFlow(LocalEventBusServerClient(LocalEventBusServer), EVENTS_FLOW)
|
||||
|
||||
fun executeWithExceptionHandling(ignoreExceptions: Boolean = true, block: () -> Unit) {
|
||||
try {
|
||||
block()
|
||||
}
|
||||
catch (t: Throwable) {
|
||||
if (ignoreExceptions) {
|
||||
LOG.info("Ignored: $t")
|
||||
runCatching { block() }.onFailure { t ->
|
||||
if (ignoreExceptions) {
|
||||
LOG.info("Ignored: $t")
|
||||
} else {
|
||||
throw t
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw t
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user