This commit is contained in:
DBotThePony 2022-10-12 16:12:03 +07:00
parent 5970671521
commit a7b45671f5
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -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 <V> 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
}