diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/GlobalEventHandler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/GlobalEventHandler.kt index d9809360d..2a0ca3784 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/GlobalEventHandler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/GlobalEventHandler.kt @@ -85,11 +85,12 @@ fun runIfClient(lambda: () -> Unit) { if (isClient) { lambda.invoke() } - } catch(_: ClassNotFoundException) { } catch(err: RuntimeException) { if (err.message?.startsWith("Attempted to load class") != true) { throw err } + + LOGGER.error("Unexpected classloading exception", err) } } @@ -99,11 +100,10 @@ fun runIfClient(value: V, lambda: () -> V): V { return lambda.invoke() } - return value - } catch(err: ClassNotFoundException) { return value } catch(err: RuntimeException) { if (err.message?.startsWith("Attempted to load class") == true) { + LOGGER.error("Unexpected classloading exception", err) return value }